setup_env.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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-22
  16. #As default it updates the ant scripts
  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. #No args
  23. if [ $# -lt 1 ]; then
  24. echo "No args found"
  25. echo "Usage : $0 [gradle | maven | ant]"
  26. exit
  27. fi
  28. #checking args
  29. case "$1" in
  30. "ant")
  31. echo "Creating Ant environment"
  32. initForAnt
  33. ;;
  34. "gradle") echo "Creating gradle environment"
  35. initDefault
  36. ;;
  37. "maven") echo "Creating maven environment"
  38. initDefault
  39. ;;
  40. *) echo "Argument not recognized"
  41. echo "Usage : $0 [gradle | maven | ant]"
  42. ;;
  43. esac
  44. exit