X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2Fmwdocgen.php;h=1e0221eb31e69d9ef992750244a3dbe08af44cf9;hb=2ec322f6c28eda03842a41413ec03bca9d97ba6d;hp=c67c2ce3913be7dec3c095630360a996ba13eedf;hpb=58ae12601a55ce60b651f3420b0b367d408ac35b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index c67c2ce391..1e0221eb31 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -1,21 +1,33 @@ $outputDirectory, '{{STRIP_FROM_PATH}}' => $stripFromPath, @@ -146,6 +164,8 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, '{{SVNSTAT}}' => $svnstat, '{{INPUT}}' => $input, '{{EXCLUDE}}' => $exclude, + '{{EXCLUDE_PATTERNS}}' => $exclude_patterns, + '{{HAVE_DOT}}' => `which dot` ? 'YES' : 'NO', ); $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template ); $tmpFileName = tempnam( wfTempDir(), 'mwdocgen-' ); @@ -160,20 +180,51 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, unset( $file ); -if ( is_array( $argv ) && isset( $argv[1] ) ) { - switch( $argv[1] ) { - case '--all': $input = 0; break; - case '--includes': $input = 1; break; - case '--languages': $input = 2; break; - case '--maintenance': $input = 3; break; - case '--skins': $input = 4; break; - case '--file': - $input = 5; - if ( isset( $argv[2] ) ) { - $file = $argv[2]; +if ( is_array( $argv ) ) { + for ($i = 0; $i < count($argv); $i++ ) { + switch( $argv[$i] ) { + case '--all': $input = 0; break; + case '--includes': $input = 1; break; + case '--languages': $input = 2; break; + case '--maintenance': $input = 3; break; + case '--skins': $input = 4; break; + case '--file': + $input = 5; + $i++; + if ( isset( $argv[$i] ) ) { + $file = $argv[$i]; + } + break; + case '--no-extensions': $input = 6; break; + case '--output': + $i++; + if ( isset( $argv[$i] ) ) { + $doxyOutput = realpath( $argv[$i] ); + } + break; + case '--help': + print <<] [] + +Commands: + --all Process entire codebase + --includes Process only files in includes/ dir + --languages Process only files in languages/ dir + --maintenance Process only files in maintenance/ dir + --skins Process only files in skins/ dir + --file Process only the given file + +If no command is given, you will be prompted. + +Other options: + --output Set output directory (default $doxyOutput) + --help Show this help and exit. + + +END; + exit(0); + break; } - break; - case '--no-extensions': $input = 6; break; } } @@ -212,18 +263,23 @@ case 5: $input = $mwPath . $file; case 6: $input = $mwPath; - $exclude = 'extensions'; + $exclude_patterns = 'extensions'; } $versionNumber = getSvnRevision( $input ); if ( $versionNumber === false ) { # Not using subversion ? $svnstat = ''; # Not really useful if subversion not available - $version = 'trunk'; # FIXME + # @todo FIXME + $version = 'trunk'; } else { $version = "trunk (r$versionNumber)"; } -$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $svnstat, $input, $exclude ); +// Generate path exclusions +$excludedPaths = $mwPath . join( " $mwPath", $mwExcludePaths ); +print "EXCLUDE: $excludedPaths\n\n"; + +$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $svnstat, $input, $excludedPaths, $exclude_patterns ); $command = $doxygenBin . ' ' . $generatedConf; echo <<