Merge branch 'us4_view_text_files' of github.com:owncloudChalmers/android into us4_vi...
[pub/Android/ownCloud.git] / setup_env.sh
1 #!/bin/bash -e
2
3
4 #Repository
5 ActionBarSherlockRepo="https://github.com/JakeWharton/ActionBarSherlock.git"
6
7 #Directory for actionbarsherlock
8 DIRECTORY="actionbarsherlock"
9
10 #Commit for version 4.2 of actionbar sherlock
11 COMMIT="90939dc3925ffaaa0de269bbbe1b35e274968ea1"
12
13
14 function initDefault {
15 git submodule init
16 git submodule update
17 android update lib-project -p owncloud-android-library
18 android update project -p .
19 android update project -p oc_jb_workaround
20 android update test-project -p tests -m ..
21 }
22
23 function initForAnt {
24 #If the directory exists the script has already been executed
25 if [ ! -d "$DIRECTORY" ]; then
26
27 #Gets the owncloud-android-library
28 git submodule init
29 git submodule update
30
31 #Clones the actionbarsherlock and checks-out the right release (4.2.0)
32 git clone $ActionBarSherlockRepo $DIRECTORY
33 cd $DIRECTORY
34 git checkout $COMMIT
35 cd ../
36
37 #As default it updates the ant scripts
38 android update project -p "$DIRECTORY"/library -n ActionBarSherlock --target android-19
39 android update lib-project -p owncloud-android-library
40 android update project -p .
41 android update project -p oc_jb_workaround
42 cp third_party/android-support-library/android-support-v4.jar actionbarsherlock/library/libs/android-support-v4.jar
43 android update test-project -p tests -m ..
44 fi
45 }
46
47 #No args
48 if [ $# -lt 1 ]; then
49 echo "No args found"
50 echo "Usage : $0 [gradle | maven | ant]"
51 exit
52 fi
53
54 #checking args
55 case "$1" in
56
57 "ant")
58 echo "Creating Ant environment"
59 initForAnt
60 ;;
61
62 "gradle") echo "Creating gradle environment"
63 initDefault
64 ;;
65
66 "maven") echo "Creating maven environment"
67 initDefault
68 ;;
69
70 *) echo "Argument not recognized"
71 echo "Usage : $0 [gradle | maven | ant]"
72 ;;
73 esac
74
75 exit