install_prereqs.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright 2018 Google
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # Within Travis, installs prerequisites for a build.
  15. # Examines the following configured environment variables that should be
  16. # specified in an env: block
  17. # - PROJECT - Firebase or Firestore
  18. # - METHOD - xcodebuild or cmake; default is xcodebuild
  19. if [[ -z "$METHOD" ]]; then
  20. METHOD="xcodebuild"
  21. fi
  22. case "$PROJECT-$METHOD" in
  23. *-xcodebuild)
  24. bundle install
  25. gem install xcpretty
  26. ;;
  27. Firestore-cmake)
  28. bundle install
  29. # xcpretty is helpful for the intermediate step which builds FirebaseCore
  30. # using xcodebuild.
  31. gem install xcpretty
  32. brew outdated cmake || brew upgrade cmake
  33. brew outdated go || brew upgrade go # Somehow the build for Abseil requires this.
  34. ;;
  35. *)
  36. echo "Unknown project-method combo" 1>&2
  37. echo " PROJECT=$PROJECT" 1>&2
  38. echo " METHOD=$METHOD" 1>&2
  39. exit 1
  40. ;;
  41. esac