Merge "mwdocgen.php: Exit with exit code of passthru(doxygen)"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 15 Mar 2013 07:57:14 +0000 (07:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 15 Mar 2013 07:57:14 +0000 (07:57 +0000)
1  2 
maintenance/mwdocgen.php

diff --combined maintenance/mwdocgen.php
@@@ -63,8 -63,6 +63,8 @@@ $doxygenInputFilter = "php {$mwPath}mai
  /** where Phpdoc should output documentation */
  $doxyOutput = $mwPath . 'docs' . DIRECTORY_SEPARATOR ;
  
 +$doxyVersion = 'master';
 +
  /** MediaWiki subpaths */
  $mwPathI = $mwPath . 'includes/';
  $mwPathL = $mwPath . 'languages/';
@@@ -166,12 -164,6 +166,12 @@@ if ( is_array( $argv ) ) 
                                $doxyOutput = realpath( $argv[$i] );
                        }
                        break;
 +              case '--version':
 +                      $i++;
 +                      if ( isset( $argv[$i] ) ) {
 +                              $doxyVersion = $argv[$i];
 +                      }
 +                      break;
                case '--generate-man':
                        $doxyGenerateMan = true;
                        break;
@@@ -191,9 -183,8 +191,9 @@@ Commands
  If no command is given, you will be prompted.
  
  Other options:
 -    --output <dir>  Set output directory (default $doxyOutput)
 +    --output <dir>  Set output directory (default: $doxyOutput)
      --generate-man  Generates man page documentation
 +    --version       Project version to display in the outut (default: $doxyVersion)
      --help          Show this help and exit.
  
  
@@@ -243,11 -234,14 +243,11 @@@ case 6
        $excludePatterns = 'extensions';
  }
  
 -// @todo FIXME to work on git
 -$version = 'master';
 -
  // Generate path exclusions
  $excludedPaths = $mwPath . join( " $mwPath", $mwExcludePaths );
  print "EXCLUDE: $excludedPaths\n\n";
  
 -$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $input, $excludedPaths, $excludePatterns, $doxyGenerateMan, $doxygenInputFilter );
 +$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $doxyVersion, $input, $excludedPaths, $excludePatterns, $doxyGenerateMan, $doxygenInputFilter );
  $command = $doxygenBin . ' ' . $generatedConf;
  
  echo <<<TEXT
@@@ -260,7 -254,8 +260,8 @@@ $comman
  
  TEXT;
  
- passthru( $command );
+ $exitcode = 1;
+ passthru( $command, $exitcode );
  
  echo <<<TEXT
  ---------------------------------------------------
@@@ -270,3 -265,5 +271,5 @@@ Check above for possible errors
  You might want to delete the temporary file $generatedConf
  
  TEXT;
+ exit( $exitcode );