-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·63 lines (54 loc) · 1.6 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
#!/bin/bash
title=$(less game.project | grep "^title = " | cut -d "=" -f2 | sed -e 's/^[[:space:]]*//')
title_no_space=$(echo -e "${title}" | tr -d '[[:space:]]')
echo "Project: ${title}"
if [ ! -f bob.jar ]
then
echo "Unable to find bob.jar. Download it from d.defold.com."
exit 1
fi
bob() {
java -jar bob.jar $@
}
bundle() {
platform=$1
echo "${platform}"
shift 1
echo "making director ./build/${platform}"
bob --platform ${platform} --bundle-output build/${platform} $@ bundle
}
archive() {
platform=$1
if [ "${platform}" == "armv7-android" ]
then
echo "${title_no_space}.apk"
mv "build/${platform}/${title}/${title}.apk" "${title_no_space}.apk"
elif [ "${platform}" == "armv7-darwin" ]
then
echo "${title_no_space}.ipa"
mv "build/${platform}/${title}/${title}.ipa" "${title_no_space}.ipa"
else
echo "${title_no_space}_${platform}.zip"
rm -rf "${title_no_space}_${platform}.zip"
cd build/${platform}
zip -r -q "../../${title_no_space}_${platform}.zip" *
cd ../..
fi
}
# bob --email [email protected] --auth foobar resolve
# build
# bundle platforms
echo -e "\n[Bundling]"
# bundle armv7-android --private-key key.pk8 --certificate certificate.pem
# bundle armv7-darwin --identity foobar --mobileprovisioning foobar.mobileprovision
# bundle x86-win32
# bundle x86-darwin
bundle x86_64-linux
bundle js-web
# # archive bundled platforms
# echo -e "\n[Archiving]"
# archive armv7-android
# archive x86-win32
# archive x86-darwin
archive x86_64-linux
archive js-web