[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/aphlict/management/ -> PhabricatorAphlictManagementBuildWorkflow.php (source)

   1  <?php
   2  
   3  final class PhabricatorAphlictManagementBuildWorkflow
   4    extends PhabricatorAphlictManagementWorkflow {
   5  
   6    public function didConstruct() {
   7      $this
   8        ->setName('build')
   9        ->setSynopsis(pht('Build the Aphlict client.'))
  10        ->setArguments(
  11          array(
  12            array(
  13              'name' => 'debug',
  14              'help' => 'Enable a debug build.',
  15            ),
  16          ));
  17    }
  18  
  19    public function execute(PhutilArgumentParser $args) {
  20      $console = PhutilConsole::getConsole();
  21      $root = dirname(__FILE__).'/../../../..';
  22  
  23      if (!Filesystem::binaryExists('mxmlc')) {
  24        throw new PhutilArgumentUsageException(
  25          pht(
  26            "The `mxmlc` binary was not found in PATH. This compiler binary ".
  27            "is required to rebuild the Aphlict client.\n\n".
  28            "Adjust your PATH, or install the Flex SDK from:\n\n".
  29            "    http://flex.apache.org\n\n".
  30            "You may also be able to install it with `npm`:\n\n".
  31            "    $ npm install flex-sdk\n\n".
  32            "(Note: you should only need to rebuild Aphlict if you are ".
  33            "developing Phabricator.)"));
  34      }
  35  
  36      $argv = array(
  37        "-source-path=$root/externals/vegas/src",
  38        '-static-link-runtime-shared-libraries=true',
  39        '-warnings=true',
  40        '-strict=true',
  41      );
  42  
  43      if ($args->getArg('debug')) {
  44        $argv[] = '-debug=true';
  45      }
  46  
  47      list ($err, $stdout, $stderr) = exec_manual('mxmlc %Ls -output=%s %s',
  48        $argv,
  49        $root.'/webroot/rsrc/swf/aphlict.swf',
  50        $root.'/support/aphlict/client/src/AphlictClient.as');
  51  
  52      if ($err) {
  53        $console->writeErr($stderr);
  54        return 1;
  55      }
  56  
  57      $console->writeOut("Done.\n");
  58      return 0;
  59    }
  60  
  61  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1