From aea62a618c640993f8391b4c7487f089ba3d3402 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 4 Oct 2009 09:50:33 +0000 Subject: [PATCH] * Add --no-extensions option to mwdocgen.php to exclude the extensions directory * Always exclude .svn directories --- maintenance/Doxyfile | 2 +- maintenance/mwdocgen.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/maintenance/Doxyfile b/maintenance/Doxyfile index cdc748d8e9..db737bff9d 100644 --- a/maintenance/Doxyfile +++ b/maintenance/Doxyfile @@ -135,7 +135,7 @@ FILE_PATTERNS = *.c \ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = YES -EXCLUDE_PATTERNS = LocalSettings.php AdminSettings.php +EXCLUDE_PATTERNS = LocalSettings.php AdminSettings.php .svn {{EXCLUDE}} EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 3a78f6785d..a1b2dd095d 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -61,6 +61,7 @@ $mwPathS = $mwPath.'skins/'; /** Variable to get user input */ $input = ''; +$exclude = ''; # # Functions @@ -129,7 +130,7 @@ function getSvnRevision( $dir ) { * @param $svnstat String: path to the svnstat file * @param $input String: Path to analyze. */ -function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input ){ +function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input, $exclude ){ global $tmpPath; $template = file_get_contents( $doxygenTemplate ); @@ -141,6 +142,7 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, '{{CURRENT_VERSION}}' => $currentVersion, '{{SVNSTAT}}' => $svnstat, '{{INPUT}}' => $input, + '{{EXCLUDE}}' => $exclude, ); $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template ); $tmpFileName = $tmpPath . 'mwdocgen'. rand() .'.tmp'; @@ -168,6 +170,7 @@ if( is_array( $argv ) && isset( $argv[1] ) ) { $file = $argv[2]; } break; + case '--no-extensions': $input = 6; break; } } @@ -182,6 +185,7 @@ Several documentation possibilities: 3 : only maintenance 4 : only skins 5 : only a given file + 6 : all but the extensions directory OPTIONS; while ( !is_numeric($input) ) { @@ -203,6 +207,9 @@ case 5: $file = readaline( "Enter file name $mwPath" ); } $input = $mwPath.$file; +case 6: + $input = $mwPath; + $exclude = 'extensions'; } $versionNumber = getSvnRevision( $input ); @@ -213,7 +220,7 @@ if( $versionNumber === false ){ #Not using subversion ? $version = "trunk (r$versionNumber)"; } -$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $svnstat, $input ); +$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $svnstat, $input, $exclude ); $command = $doxygenBin . ' ' . $generatedConf; echo <<