setup_env.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #As default it updates the ant scripts
  18. android update lib-project -p owncloud-android-library
  19. android update project -p .
  20. android update project -p oc_jb_workaround
  21. android update test-project -p tests -m ..
  22. }
  23. #No args
  24. if [ $# -lt 1 ]; then
  25. echo "No args found"
  26. echo "Usage : $0 [gradle | maven | ant]"
  27. exit
  28. fi
  29. #checking args
  30. case "$1" in
  31. "ant")
  32. echo "Creating Ant environment"
  33. initForAnt
  34. ;;
  35. "gradle") echo "Creating gradle environment"
  36. initDefault
  37. ;;
  38. "maven") echo "Creating maven environment"
  39. initDefault
  40. ;;
  41. *) echo "Argument not recognized"
  42. echo "Usage : $0 [gradle | maven | ant]"
  43. ;;
  44. esac
  45. exit