diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 0d6af5f4ce..8f9bf00bac 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1105,6 +1105,7 @@ phutil_register_library_map(array( 'PhabricatorActionView' => 'view/layout/PhabricatorActionView.php', 'PhabricatorAllCapsTranslation' => 'infrastructure/internationalization/translation/PhabricatorAllCapsTranslation.php', 'PhabricatorAnchorView' => 'view/layout/PhabricatorAnchorView.php', + 'PhabricatorAphlictManagementBuildWorkflow' => 'applications/aphlict/management/PhabricatorAphlictManagementBuildWorkflow.php', 'PhabricatorAphlictManagementDebugWorkflow' => 'applications/aphlict/management/PhabricatorAphlictManagementDebugWorkflow.php', 'PhabricatorAphlictManagementRestartWorkflow' => 'applications/aphlict/management/PhabricatorAphlictManagementRestartWorkflow.php', 'PhabricatorAphlictManagementStartWorkflow' => 'applications/aphlict/management/PhabricatorAphlictManagementStartWorkflow.php', @@ -3877,6 +3878,7 @@ phutil_register_library_map(array( 'PhabricatorActionView' => 'AphrontView', 'PhabricatorAllCapsTranslation' => 'PhabricatorTranslation', 'PhabricatorAnchorView' => 'AphrontView', + 'PhabricatorAphlictManagementBuildWorkflow' => 'PhabricatorAphlictManagementWorkflow', 'PhabricatorAphlictManagementDebugWorkflow' => 'PhabricatorAphlictManagementWorkflow', 'PhabricatorAphlictManagementRestartWorkflow' => 'PhabricatorAphlictManagementWorkflow', 'PhabricatorAphlictManagementStartWorkflow' => 'PhabricatorAphlictManagementWorkflow', diff --git a/src/applications/aphlict/management/PhabricatorAphlictManagementBuildWorkflow.php b/src/applications/aphlict/management/PhabricatorAphlictManagementBuildWorkflow.php new file mode 100644 index 0000000000..b2665c47a1 --- /dev/null +++ b/src/applications/aphlict/management/PhabricatorAphlictManagementBuildWorkflow.php @@ -0,0 +1,53 @@ +setName('build') + ->setSynopsis(pht('Build the Aphlict client.')) + ->setArguments( + array( + array( + 'name' => 'debug', + 'help' => 'Enable a debug build.', + ), + )); + } + + public function execute(PhutilArgumentParser $args) { + $console = PhutilConsole::getConsole(); + $root = dirname(__FILE__).'/../../../..'; + + if (!Filesystem::binaryExists('mxmlc')) { + $console->writeErr('`mxmlc` is not installed.'); + return 1; + } + + $argv = array( + "-source-path=$root/externals/vegas/src", + '-static-link-runtime-shared-libraries=true', + '-warnings=true', + '-strict=true', + ); + + if ($args->getArg('debug')) { + $argv[] = '-debug=true'; + } + + list ($err, $stdout, $stderr) = exec_manual('mxmlc %Ls -output=%s %s', + $argv, + $root.'/webroot/rsrc/swf/aphlict.swf', + $root.'/support/aphlict/client/src/AphlictClient.as'); + + if ($err) { + $console->writeErr($stderr); + return 1; + } + + $console->writeOut("Done.\n"); + return 0; + } + +} diff --git a/support/aphlict/client/build_aphlict_client.sh b/support/aphlict/client/build_aphlict_client.sh deleted file mode 100755 index 7c9eb01bc6..0000000000 --- a/support/aphlict/client/build_aphlict_client.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -BASEDIR=`dirname $0` -ROOT=`cd $BASEDIR/../../../ && pwd`; - -if [ -z "$MXMLC" ]; then - echo "ERROR: Define environmental variable MXMLC to point to 'mxmlc' binary."; - exit 1; -fi; - -set -e - -$MXMLC \ - -output=$ROOT/webroot/rsrc/swf/aphlict.swf \ - -strict=true \ - -warnings=true \ - -source-path=$ROOT/externals/vegas/src \ - -static-link-runtime-shared-libraries=true \ - $BASEDIR/src/AphlictClient.as diff --git a/support/aphlict/server/aphlict_launcher.php b/support/aphlict/server/aphlict_launcher.php index c64c7feb68..38cf33aa54 100755 --- a/support/aphlict/server/aphlict_launcher.php +++ b/support/aphlict/server/aphlict_launcher.php @@ -22,5 +22,6 @@ $args->parseWorkflows(array( new PhabricatorAphlictManagementStopWorkflow(), new PhabricatorAphlictManagementRestartWorkflow(), new PhabricatorAphlictManagementDebugWorkflow(), + new PhabricatorAphlictManagementBuildWorkflow(), new PhutilHelpArgumentWorkflow(), ));