forked from HaxePunk/HaxePunk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-build.sh
executable file
·53 lines (46 loc) · 1.22 KB
/
travis-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
47
48
49
50
51
52
53
#!/bin/bash
set -e
BUILD_DIR=${TRAVIS_BUILD_DIR:-$(pwd)}
# Set command
if [[ $NME ]]; then
COMMAND=nme
TARGETS="neko cpp"
fi
if [[ $LIME ]]; then
COMMAND=lime
TARGETS="neko cpp html5"
fi
# HaxePunk tool
echo "Compiling tool.n"
cd $BUILD_DIR/tools
haxe tool.hxml || exit 1
# Unit testing
if [[ $TEST ]]; then
echo "Running unit tests"
cd $BUILD_DIR/tests
haxelib run munit test test-${TEST}.hxml -coverage || exit 1
fi
# Examples
if [[ $COMMAND ]]; then
for TARGET in $TARGETS; do
echo "Building examples with" $TARGET "using" $COMMAND
cd $BUILD_DIR
for EXAMPLE in `find examples -mindepth 1 -maxdepth 1 -type d`; do
echo "Building" $EXAMPLE "..."
cd $BUILD_DIR/$EXAMPLE
haxelib run $COMMAND build $TARGET || exit 1
done
done
fi
# Documentation
if [[ $COMMAND ]] && [[ $DOCS ]]; then
echo "Generating documentation"
cd $BUILD_DIR/doc
haxelib run $COMMAND build neko -xml
haxelib run dox -i `find bin -name 'types.xml'` -o pages/ -theme theme/ \
-in haxepunk --title "HaxePunk" \
-D source-path "https://github.com/HaxePunk/HaxePunk/tree/master" > log.txt || {
cat log.txt;
exit 1;
}
fi