mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
Add a ./bin/aphlict build
workflow.
Summary: Currently, it is a bit tricky to build the Aphlict client SWF from the ActionScript source. Provide a `./bin/aphlict build` workflow that simplifies this process. Depends on D9226. Test Plan: Executed the workflow: ``` > ./bin/aphlict build Done. ``` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9338
This commit is contained in:
parent
b1362e4e46
commit
ddf5412cbb
4 changed files with 56 additions and 19 deletions
|
@ -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',
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorAphlictManagementBuildWorkflow
|
||||
extends PhabricatorAphlictManagementWorkflow {
|
||||
|
||||
public function didConstruct() {
|
||||
$this
|
||||
->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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
|
@ -22,5 +22,6 @@ $args->parseWorkflows(array(
|
|||
new PhabricatorAphlictManagementStopWorkflow(),
|
||||
new PhabricatorAphlictManagementRestartWorkflow(),
|
||||
new PhabricatorAphlictManagementDebugWorkflow(),
|
||||
new PhabricatorAphlictManagementBuildWorkflow(),
|
||||
new PhutilHelpArgumentWorkflow(),
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue