zip_quickstart_test.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env bash
  2. # Copyright 2022 Google LLC
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # Build the quickstart. If we're running on the main repo (not a fork), we
  16. # also run the tests along with the decoded GoogleService-Info.plist files.
  17. set -eo pipefail
  18. set -x
  19. EXIT_STATUS=0
  20. cd "${SAMPLE}"
  21. if [[ ! -z "$LEGACY" ]]; then
  22. cd "Legacy${SAMPLE}Quickstart"
  23. fi
  24. xcode_version=$(xcodebuild -version | grep Xcode)
  25. xcode_version="${xcode_version/Xcode /}"
  26. xcode_major="${xcode_version/.*/}"
  27. if [[ "$xcode_major" -lt 15 ]]; then
  28. device_name="iPhone 14"
  29. elif [[ "$xcode_major" -lt 16 ]]; then
  30. device_name="iPhone 15"
  31. else
  32. device_name="iPhone 16"
  33. fi
  34. (
  35. xcodebuild \
  36. -project ${SAMPLE}Example.xcodeproj \
  37. -scheme ${SAMPLE}Example${SWIFT_SUFFIX} \
  38. -destination "platform=iOS Simulator,name=$device_name" "SWIFT_VERSION=5.3" "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ObjC" "FRAMEWORK_SEARCH_PATHS= \$(PROJECT_DIR)/Firebase/" HEADER_SEARCH_PATHS='$(PROJECT_DIR)/Firebase' \
  39. build \
  40. ) || EXIT_STATUS=$?
  41. exit $EXIT_STATUS