1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Build ACP JavaScript in build script

This commit is contained in:
Tim Düsterhus 2013-09-08 20:57:11 +02:00
parent 5c440c1add
commit 877fe2b3a8

View File

@ -28,6 +28,7 @@
if (file_exists('acptemplate.tar')) unlink('acptemplate.tar'); if (file_exists('acptemplate.tar')) unlink('acptemplate.tar');
foreach (glob('file/acp/be.bastelstu.chat.nodePush/lib/*.js') as $nodeFile) unlink($nodeFile); foreach (glob('file/acp/be.bastelstu.chat.nodePush/lib/*.js') as $nodeFile) unlink($nodeFile);
foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile); foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile);
foreach (glob('file/acp/js/*.js') as $jsFile) unlink($jsFile);
if (file_exists('be.bastelstu.chat.tar')) unlink('be.bastelstu.chat.tar'); if (file_exists('be.bastelstu.chat.tar')) unlink('be.bastelstu.chat.tar');
echo <<<EOT echo <<<EOT
@ -42,6 +43,17 @@
} }
echo <<<EOT echo <<<EOT
Building ACP-JavaScript
-----------------------
EOT;
foreach (glob('file/acp/js/*.{litcoffee,coffee}', GLOB_BRACE) as $coffeeFile) {
echo $coffeeFile."\n";
passthru('coffee -c '.escapeshellarg($coffeeFile), $code);
if ($code != 0) exit($code);
}
echo <<<EOT
Compressing JavaScript Compressing JavaScript
---------------------- ----------------------
@ -53,6 +65,17 @@
} }
echo <<<EOT echo <<<EOT
Compressing ACP-JavaScript
--------------------------
EOT;
foreach (glob('file/acp/js/*.js', GLOB_BRACE) as $jsFile) {
echo $jsFile."\n";
passthru('uglifyjs '.escapeshellarg($jsFile).' --screw-ie8 -m -c --verbose --comments -o '.escapeshellarg(substr($jsFile, 0, -3).'.min.js'), $code);
if ($code != 0) exit($code);
}
echo <<<EOT
Checking PHP for Syntax Errors Checking PHP for Syntax Errors
------------------------------ ------------------------------
@ -122,3 +145,4 @@
if (file_exists('acptemplate.tar')) unlink('acptemplate.tar'); if (file_exists('acptemplate.tar')) unlink('acptemplate.tar');
foreach (glob('file/acp/be.bastelstu.chat.nodePush/lib/*.js') as $nodeFile) unlink($nodeFile); foreach (glob('file/acp/be.bastelstu.chat.nodePush/lib/*.js') as $nodeFile) unlink($nodeFile);
foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile); foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile);
foreach (glob('file/acp/js/*.js') as $jsFile) unlink($jsFile);