forked from owncloud/android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_env.sh
executable file
·75 lines (58 loc) · 1.89 KB
/
setup_env.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
67
68
69
70
71
72
73
74
75
#!/bin/bash -e
#Repository
ActionBarSherlockRepo="https://github.com/JakeWharton/ActionBarSherlock.git"
#Directory for actionbarsherlock
DIRECTORY="actionbarsherlock"
#Commit for version 4.2 of actionbar sherlock
COMMIT="90939dc3925ffaaa0de269bbbe1b35e274968ea1"
function initDefault {
git submodule init
git submodule update
android update lib-project -p owncloud-android-library
android update project -p .
android update project -p oc_jb_workaround
android update test-project -p tests -m ..
}
function initForAnt {
#If the directory exists the script has already been executed
if [ ! -d "$DIRECTORY" ]; then
#Gets the owncloud-android-library
git submodule init
git submodule update
#Clones the actionbarsherlock and checks-out the right release (4.2.0)
git clone $ActionBarSherlockRepo $DIRECTORY
cd $DIRECTORY
git checkout $COMMIT
cd ../
#As default it updates the ant scripts
android update project -p "$DIRECTORY"/library -n ActionBarSherlock --target android-19
android update lib-project -p owncloud-android-library
android update project -p .
android update project -p oc_jb_workaround
cp third_party/android-support-library/android-support-v4.jar actionbarsherlock/library/libs/android-support-v4.jar
android update test-project -p tests -m ..
fi
}
#No args
if [ $# -lt 1 ]; then
echo "No args found"
echo "Usage : $0 [gradle | maven | ant]"
exit
fi
#checking args
case "$1" in
"ant")
echo "Creating Ant environment"
initForAnt
;;
"gradle") echo "Creating gradle environment"
initDefault
;;
"maven") echo "Creating maven environment"
initDefault
;;
*) echo "Argument not recognized"
echo "Usage : $0 [gradle | maven | ant]"
;;
esac
exit