setup_env.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 | maven | 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. "maven") echo "Creating maven environment"
  40. initDefault
  41. ;;
  42. *) echo "Argument not recognized"
  43. echo "Usage : $0 [gradle | maven | ant]"
  44. ;;
  45. esac
  46. exit