setup 996 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -euo pipefail
  3. IFS=$'\n\t'
  4. brew update
  5. # TODO: Ensure both Brew and Caskroom are set up.
  6. if [ "$(which java)" == "" ]; then
  7. echo "ERROR: Install JDK first. Maybe use 'brew cask install java'. Leaving this to you in case you want to handle this differently."
  8. exit 1
  9. fi
  10. if [ "$(which ant)" == "" ]; then brew install ant; fi
  11. if [ "$(which mvn)" == "" ]; then brew install maven; fi
  12. if [ "$(which android)" == "" ]; then
  13. if [ ! -e "$(brew --prefix android-sdk)" ]; then
  14. brew install android-sdk
  15. else
  16. brew link android-sdk
  17. fi
  18. fi
  19. ANDROID_HOME=$(brew --prefix android-sdk)
  20. export ANDROID_HOME
  21. echo y | android update sdk --all --no-ui --filter 'tools,platform-tools'
  22. echo y | android update sdk --all --no-ui --filter 'android-23'
  23. echo y | android update sdk --all --no-ui --filter 'build-tools-23.0.2'
  24. echo y | android update sdk --all --no-ui --filter 'extra-google-m2repository'
  25. echo y | android update sdk --all --no-ui --filter 'extra-android-m2repository'