install_prereqs.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. bundle install
  20. case "$PROJECT-$PLATFORM-$METHOD" in
  21. Firebase-iOS-xcodebuild)
  22. gem install xcpretty
  23. bundle exec pod install --project-directory=Example --repo-update
  24. bundle exec pod install --project-directory=Functions/Example
  25. ;;
  26. Firebase-*-xcodebuild)
  27. gem install xcpretty
  28. bundle exec pod install --project-directory=Example --repo-update
  29. ;;
  30. Firestore-*-xcodebuild)
  31. gem install xcpretty
  32. bundle exec pod install --project-directory=Firestore/Example --repo-update
  33. ;;
  34. *-pod-lib-lint)
  35. bundle exec pod repo update
  36. ;;
  37. Firestore-*-cmake)
  38. # xcpretty is helpful for the intermediate step which builds FirebaseCore
  39. # using xcodebuild.
  40. gem install xcpretty
  41. brew outdated cmake || brew upgrade cmake
  42. brew outdated go || brew upgrade go # Somehow the build for Abseil requires this.
  43. bundle exec pod install --project-directory=Example --repo-update
  44. bundle exec pod install --project-directory=Firestore/Example \
  45. --no-repo-update
  46. ;;
  47. *)
  48. echo "Unknown project-platform-method combo" 1>&2
  49. echo " PROJECT=$PROJECT" 1>&2
  50. echo " PLATFORM=$PLATFORM" 1>&2
  51. echo " METHOD=$METHOD" 1>&2
  52. exit 1
  53. ;;
  54. esac