install_prereqs.sh 2.1 KB

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