-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·66 lines (55 loc) · 1.33 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
66
#!/bin/bash
function update_submodules {
git submodule init
check_exit_code
git submodule update
check_exit_code
}
function get_zxing {
./library-zxing.sh
check_exit_code
}
function update_android {
android update lib-project -p ./library-actionbarsherlock/library
check_exit_code
android update lib-project -p ./library-viewpagerindicator/library
check_exit_code
android update lib-project -p ./library-zxing/android
check_exit_code
android update project --name uclient -p ./app
check_exit_code
}
function build_zxing_core {
ant -f library-zxing/core/build.xml
check_exit_code
cp library-zxing/core/core.jar library-zxing/android/libs/
}
function build_debug {
ant -f app/build.xml debug
check_exit_code
}
function build_release {
ant -f app/build.xml release
check_exit_code
}
function check_exit_code {
retcode=$?
if [[ $retcode != 0 ]] ; then
exit $retcode
fi
}
function clean {
ant -f library-zxing/core/build.xml clean
ant -f library-zxing/android/build.xml cleann
ant -f library-actionbarsherlock/library/build.xml clean
ant -f library-viewpagerindicator/library/build.xml clean
ant -f app/build.xml clean
}
function main {
update_submodules
get_zxing
update_android
build_zxing_core
build_debug
}
main