install_prereqs.sh 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_824e27188cd5_key -iv $encrypted_824e27188cd5_iv \
  30. -in scripts/travis-encrypted/Secrets.tar.enc \
  31. -out scripts/travis-encrypted/Secrets.tar -d
  32. tar xvf scripts/travis-encrypted/Secrets.tar
  33. cp Secrets/Auth/Sample/Application.plist Example/Auth/Sample/Application.plist
  34. cp Secrets/Auth/Sample/AuthCredentials.h Example/Auth/Sample/AuthCredentials.h
  35. cp Secrets/Auth/Sample/GoogleService-Info_multi.plist Example/Auth/Sample/GoogleService-Info_multi.plist
  36. cp Secrets/Auth/Sample/GoogleService-Info.plist Example/Auth/Sample/GoogleService-Info.plist
  37. cp Secrets/Auth/Sample/Sample.entitlements Example/Auth/Sample/Sample.entitlements
  38. cp Secrets/Auth/ApiTests/AuthCredentials.h Example/Auth/ApiTests/AuthCredentials.h
  39. cp Secrets/Storage/App/GoogleService-Info.plist Example/Storage/App/GoogleService-Info.plist
  40. cp Secrets/Storage/App/GoogleService-Info.plist Example/Database/App/GoogleService-Info.plist
  41. fi
  42. ;;
  43. Firebase-*-xcodebuild)
  44. gem install xcpretty
  45. bundle exec pod install --project-directory=Example --repo-update
  46. bundle exec pod install --project-directory=GoogleUtilities/Example
  47. ;;
  48. Functions-*)
  49. bundle exec pod repo update
  50. # Start server for Functions integration tests.
  51. ./Functions/Backend/start.sh synchronous
  52. ;;
  53. InAppMessaging-iOS-xcodebuild)
  54. gem install xcpretty
  55. bundle exec pod install --project-directory=InAppMessagingDisplay/Example --repo-update
  56. bundle exec pod install --project-directory=InAppMessaging/Example --repo-update
  57. ;;
  58. Firestore-*-xcodebuild | Firestore-*-fuzz)
  59. gem install xcpretty
  60. bundle exec pod install --project-directory=Firestore/Example --repo-update
  61. ;;
  62. *-pod-lib-lint)
  63. bundle exec pod repo update
  64. ;;
  65. Firestore-*-cmake)
  66. brew outdated cmake || brew upgrade cmake
  67. brew outdated go || brew upgrade go # Somehow the build for Abseil requires this.
  68. # Install python packages required to generate proto sources
  69. pip install six
  70. ;;
  71. SymbolCollision-*-xcodebuild)
  72. gem install xcpretty
  73. bundle exec pod install --project-directory=SymbolCollisionTest --repo-update
  74. ;;
  75. *)
  76. echo "Unknown project-platform-method combo" 1>&2
  77. echo " PROJECT=$PROJECT" 1>&2
  78. echo " PLATFORM=$PLATFORM" 1>&2
  79. echo " METHOD=$METHOD" 1>&2
  80. exit 1
  81. ;;
  82. esac