From: Antoine Musso Date: Sat, 5 Feb 2011 13:54:26 +0000 (+0000) Subject: doxygen: add support for EXCLUDE keyword X-Git-Tag: 1.31.0-rc.0~32189 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=35f83153c0568f41c0396a465062ab9f6e4b4fe9;p=lhc%2Fweb%2Fwiklou.git doxygen: add support for EXCLUDE keyword --- diff --git a/maintenance/Doxyfile b/maintenance/Doxyfile index 54af6e0cc3..65968010b4 100644 --- a/maintenance/Doxyfile +++ b/maintenance/Doxyfile @@ -134,9 +134,9 @@ FILE_PATTERNS = *.c \ *.MM \ *.PY RECURSIVE = YES -EXCLUDE = +EXCLUDE = {{EXCLUDE}} EXCLUDE_SYMLINKS = YES -EXCLUDE_PATTERNS = LocalSettings.php AdminSettings.php StartProfiler.php .svn */.git/* {{EXCLUDE}} +EXCLUDE_PATTERNS = LocalSettings.php AdminSettings.php StartProfiler.php .svn */.git/* {{EXCLUDE_PATTERNS}} EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 9fceeb2dbd..790a27c003 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -69,9 +69,15 @@ $mwPathL = $mwPath . 'languages/'; $mwPathM = $mwPath . 'maintenance/'; $mwPathS = $mwPath . 'skins/'; +/** Ignored paths relative to $mwPath */ +$mwExcludePaths = array( + 'images', + 'static', +); + /** Variable to get user input */ $input = ''; -$exclude = ''; +$exclude_patterns = ''; # # Functions @@ -142,13 +148,18 @@ function getSvnRevision( $dir ) { * @param $currentVersion String: Version number of the software * @param $svnstat String: path to the svnstat file * @param $input String: Path to analyze. - * @param $exclude String: Additionals path regex to exclude + * @param $exclude_patterns String: Additionals path regex to exclude * (LocalSettings.php, AdminSettings.php, .svn and .git directories are always excluded) */ -function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input, $exclude ) { +function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input, $exclude_patterns ) { $template = file_get_contents( $doxygenTemplate ); + // Generate path exclusions + global $mwExcludePaths, $mwPath; + $excludedPaths = $mwPath . join( " $mwPath", $mwExcludePaths ); + print "EXCLUDE: $excludedPaths\n\n"; + // Replace template placeholders by correct values. $replacements = array( '{{OUTPUT_DIRECTORY}}' => $outputDirectory, @@ -156,7 +167,8 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, '{{CURRENT_VERSION}}' => $currentVersion, '{{SVNSTAT}}' => $svnstat, '{{INPUT}}' => $input, - '{{EXCLUDE}}' => $exclude, + '{{EXCLUDE}}' => $excludedPaths, + '{{EXCLUDE_PATTERNS}}' => $exclude_patterns, '{{HAVE_DOT}}' => `which dot` ? 'YES' : 'NO', ); $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template ); @@ -224,7 +236,7 @@ case 5: $input = $mwPath . $file; case 6: $input = $mwPath; - $exclude = 'extensions'; + $exclude_patterns = 'extensions'; } $versionNumber = getSvnRevision( $input ); @@ -235,7 +247,7 @@ if ( $versionNumber === false ) { # Not using subversion ? $version = "trunk (r$versionNumber)"; } -$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $svnstat, $input, $exclude ); +$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $svnstat, $input, $exclude_patterns ); $command = $doxygenBin . ' ' . $generatedConf; echo <<