This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.sh
executable file
·46 lines (41 loc) · 1.69 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/sh
target="$1"
debug=
verbose=
if [ $# -gt 1 ]
then
echo "Building with -debug"
debug="-debug=true"
else
debug=""
fi
if [ $# -gt 2 ]
then
echo "Building with -compiler.verbose-stacktraces"
verbose="-compiler.verbose-stacktraces=true"
else
verbose=""
fi
if [ "$target" = "swf" ]
then
echo 'Building Test SWF into build/swf/test.swf'
mxmlc -compiler.source-path=./src -static-link-runtime-shared-libraries=true $debug $verbose ./src/com/rollbar/notifier/Test.as -include-libraries=./libs/asuuid.swc -output build/swf/test.swf
elif [ "$target" = "swc" ]
then
echo 'Building Rollbar SWC into build/swc/Rollbar.swc'
compc -include-libraries=./libs/asuuid.swc -include-sources ./src/com/rollbar/json -include-sources ./src/com/rollbar/notifier -include-sources ./src/com/rollbar/stacktrace -output build/swc/Rollbar.swc
elif [ "$target" = "test" ]
then
echo 'Building test suite into build/swf/testsuite.swf'
mxmlc -compiler.source-path=./src -static-link-runtime-shared-libraries=true -debug=true -compiler.verbose-stacktraces=true -include-libraries=./libs/asuuid.swc -include-libraries=./libs/flexunit-4.1.0-8-as3_4.1.0.16076.swc ./src/com/rollbar/tests/TestRunner.as -output build/swf/testsuite.swf
ret_code=$?
if [ $ret_code == 0 ]; then
expect -c "spawn fdb build/swf/testsuite.swf; send -- continue\r; expect eof;"
else
echo 'Aborting test suite due to build failure'
fi
else
echo 'Building Notifier SWF into build/swf/RollbarNotifier.swf'
mxmlc -compiler.source-path=./src -static-link-runtime-shared-libraries=true $debug $verbose ./src/com/rollbar/notifier/RollbarNotifier.as -output build/swf/RollbarNotifer.swf
fi
echo 'Done'