install_prereqs.sh 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 secrets for integration tests and metrics collection. This does not work for pull
  27. # requests from forks. See
  28. # https://docs.travis-ci.com/user/pull-requests#pull-requests-and-security-restrictions
  29. if [[ ! -z $encrypted_d6a88994a5ab_key ]]; then
  30. openssl aes-256-cbc -K $encrypted_d6a88994a5ab_key -iv $encrypted_d6a88994a5ab_iv \
  31. -in scripts/travis-encrypted/Secrets.tar.enc \
  32. -out scripts/travis-encrypted/Secrets.tar -d
  33. tar xvf scripts/travis-encrypted/Secrets.tar
  34. cp Secrets/Auth/Sample/Application.plist Example/Auth/Sample/Application.plist
  35. cp Secrets/Auth/Sample/AuthCredentials.h Example/Auth/Sample/AuthCredentials.h
  36. cp Secrets/Auth/Sample/GoogleService-Info_multi.plist Example/Auth/Sample/GoogleService-Info_multi.plist
  37. cp Secrets/Auth/Sample/GoogleService-Info.plist Example/Auth/Sample/GoogleService-Info.plist
  38. cp Secrets/Auth/Sample/Sample.entitlements Example/Auth/Sample/Sample.entitlements
  39. cp Secrets/Auth/ApiTests/AuthCredentials.h Example/Auth/ApiTests/AuthCredentials.h
  40. cp Secrets/Storage/App/GoogleService-Info.plist Example/Storage/App/GoogleService-Info.plist
  41. cp Secrets/Storage/App/GoogleService-Info.plist Example/Database/App/GoogleService-Info.plist
  42. cp Secrets/Metrics/database.config Metrics/database.config
  43. fi
  44. ;;
  45. Firebase-*-xcodebuild)
  46. gem install xcpretty
  47. bundle exec pod install --project-directory=Example --repo-update
  48. bundle exec pod install --project-directory=GoogleUtilities/Example
  49. ;;
  50. Functions-*)
  51. bundle exec pod repo update
  52. # Start server for Functions integration tests.
  53. ./Functions/Backend/start.sh synchronous
  54. ;;
  55. InAppMessaging-iOS-xcodebuild)
  56. gem install xcpretty
  57. bundle exec pod install --project-directory=InAppMessagingDisplay/Example --repo-update
  58. bundle exec pod install --project-directory=InAppMessaging/Example --repo-update
  59. ;;
  60. Firestore-*-xcodebuild | Firestore-*-fuzz)
  61. gem install xcpretty
  62. bundle exec pod install --project-directory=Firestore/Example --repo-update
  63. ;;
  64. *-pod-lib-lint)
  65. bundle exec pod repo update
  66. ;;
  67. Firestore-*-cmake)
  68. brew outdated cmake || brew upgrade cmake
  69. brew outdated go || brew upgrade go # Somehow the build for Abseil requires this.
  70. # Install python packages required to generate proto sources
  71. pip install six
  72. ;;
  73. SymbolCollision-*-xcodebuild)
  74. gem install xcpretty
  75. bundle exec pod install --project-directory=SymbolCollisionTest --repo-update
  76. ;;
  77. GoogleDataTransport-iOS-xcodebuild)
  78. gem install xcpretty
  79. bundle exec pod gen GoogleDataTransport.podspec --gen-directory=GoogleDataTransport/gen
  80. ;;
  81. GoogleDataTransportCCTSupport-iOS-xcodebuild)
  82. gem install xcpretty
  83. # TODO(mikehaney24): Remove the SpecsStaging repo once GDT is published.
  84. bundle exec pod gen GoogleDataTransportCCTSupport.podspec \
  85. --gen-directory=GoogleDataTransportCCTSupport/gen \
  86. --sources=https://github.com/Firebase/SpecsStaging.git,https://github.com/CocoaPods/Specs.git
  87. ;;
  88. *)
  89. echo "Unknown project-platform-method combo" 1>&2
  90. echo " PROJECT=$PROJECT" 1>&2
  91. echo " PLATFORM=$PLATFORM" 1>&2
  92. echo " METHOD=$METHOD" 1>&2
  93. exit 1
  94. ;;
  95. esac