install_prereqs.sh 2.9 KB

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