install_prereqs.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. # Set up GoogleService-Info.plist for Storage and Database integration tests. The decrypting
  27. # is not supported for pull requests. See https://docs.travis-ci.com/user/encrypting-files/
  28. if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
  29. openssl aes-256-cbc -K $encrypted_2c8d10c8cc1d_key -iv $encrypted_2c8d10c8cc1d_iv \
  30. -in scripts/travis-encrypted/database-storage/GoogleService-Info.plist.enc \
  31. -out Example/Storage/App/GoogleService-Info.plist -d
  32. cp Example/Storage/App/GoogleService-Info.plist Example/Database/App/GoogleService-Info.plist
  33. fi
  34. ;;
  35. Firebase-*-xcodebuild)
  36. gem install xcpretty
  37. bundle exec pod install --project-directory=Example --repo-update
  38. bundle exec pod install --project-directory=GoogleUtilities/Example
  39. ;;
  40. Firestore-*-xcodebuild | Firestore-*-fuzz)
  41. gem install xcpretty
  42. bundle exec pod install --project-directory=Firestore/Example --repo-update
  43. ;;
  44. *-pod-lib-lint)
  45. bundle exec pod repo update
  46. ;;
  47. Firestore-*-cmake)
  48. brew outdated cmake || brew upgrade cmake
  49. brew outdated go || brew upgrade go # Somehow the build for Abseil requires this.
  50. # Install python packages required to generate proto sources
  51. pip install six
  52. ;;
  53. *)
  54. echo "Unknown project-platform-method combo" 1>&2
  55. echo " PROJECT=$PROJECT" 1>&2
  56. echo " PLATFORM=$PLATFORM" 1>&2
  57. echo " METHOD=$METHOD" 1>&2
  58. exit 1
  59. ;;
  60. esac