setup_env.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash -e
  2. function initDefault {
  3. git submodule init
  4. git submodule update
  5. android update lib-project -p owncloud-android-library
  6. android update project -p .
  7. android update project -p oc_jb_workaround
  8. android update test-project -p tests -m ..
  9. }
  10. function initForAnt {
  11. #Gets the owncloud-android-library
  12. git submodule init
  13. git submodule update
  14. #Prepare project android-support-appcompat-v7 ; JAR file is not enough, includes resources
  15. android update lib-project -p libs/android-support-appcompat-v7-exploded-aar --target android-23
  16. android update lib-project -p libs/android-support-design-exploded-aar --target android-23
  17. android update lib-project -p libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar --target android-22
  18. #As default it updates the ant scripts
  19. android update lib-project -p owncloud-android-library
  20. android update project -p .
  21. android update project -p oc_jb_workaround
  22. android update test-project -p tests -m ..
  23. }
  24. #No args
  25. if [ $# -lt 1 ]; then
  26. echo "No args found"
  27. echo "Usage : $0 [gradle | ant]"
  28. exit
  29. fi
  30. #checking args
  31. case "$1" in
  32. "ant")
  33. echo "Creating Ant environment"
  34. initForAnt
  35. ;;
  36. "gradle") echo "Creating gradle environment"
  37. initDefault
  38. ;;
  39. *) echo "Argument not recognized"
  40. echo "Usage : $0 [gradle | ant]"
  41. ;;
  42. esac
  43. exit