* Add --no-extensions option to mwdocgen.php to exclude the extensions directory
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 4 Oct 2009 09:50:33 +0000 (09:50 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 4 Oct 2009 09:50:33 +0000 (09:50 +0000)
* Always exclude .svn directories

maintenance/Doxyfile
maintenance/mwdocgen.php

index cdc748d..db737bf 100644 (file)
@@ -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
index 3a78f67..a1b2dd0 100644 (file)
@@ -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 <<<TEXT