-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.sh
executable file
·66 lines (57 loc) · 1.44 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#########################################################
#
# Simple batch building script
#
# Written by :
# Greg Caldwell - Geepers Interactive Ltd. 2014
# http://www.geepersinteractive.co.uk
#
# Blog: http://www.geepers.co.uk
#
# Requirements:
#
# Only tested on my MAC.
#
# Description:
#
# Loops through the current directory which is assumed
# to contain project folders, each with there own
# project.xml file. Either a debug or release (non-debug
# but not publishable build) of the each project for a
# specified target
#
# Usage: build.sh <target> <build-type>
#
# target = mac|windows|linux|html5|flash|ios|android|blackberry|tizen|emscripten|webos
# build-type = debug|release : Optional and defaults to 'release'
#
#########################################################
if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]
then
echo "Usage: build.sh <target> <build-type>"
echo
echo " target = mac|windows|linux|html5|flash|ios|android|blackberry|tizen|emscripten|webos"
echo " build-type = debug|release : Optional and defaults to 'release'"
exit 1
fi
TARGET=$1
BUILD=${2:-release}
if [[ $BUILD == "debug" ]]
then
BUILDTYPE="-debug"
else
BUILDTYPE=""
fi
for DIR in $(find . -type d -maxdepth 1 -not -name . -not -name .git);
do
echo "Building $DIR for $TARGET";
cd "./$DIR"
if [ -f "./project.xml" ]
then
lime build $TARGET $BUILDTYPE > "$DIR.log"
fi
cd ..
done
echo
echo "All builds completed."