build.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. #!/usr/bin/env bash
  2. # Copyright 2018 Google
  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. # USAGE: build.sh product [platform] [method]
  16. #
  17. # Builds the given product for the given platform using the given build method
  18. function pod_gen() {
  19. # Call pod gen with a podspec and additional optional arguments.
  20. bundle exec pod gen --local-sources=./ --sources=https://github.com/firebase/SpecsDev.git,https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/ "$@"
  21. }
  22. set -euo pipefail
  23. if [[ $# -lt 1 ]]; then
  24. cat 1>&2 <<EOF
  25. USAGE: $0 product [platform] [method]
  26. product can be one of:
  27. Firebase
  28. Firestore
  29. CombineSwift
  30. InAppMessaging
  31. Messaging
  32. MessagingSample
  33. SwiftUISample
  34. MLModelDownloaderSample
  35. RemoteConfig
  36. RemoteConfigSample
  37. Storage
  38. SymbolCollision
  39. GoogleDataTransport
  40. Performance
  41. platform can be one of:
  42. iOS (default)
  43. iOS-device
  44. macOS
  45. tvOS
  46. watchOS
  47. catalyst
  48. method can be one of:
  49. xcodebuild (default)
  50. cmake
  51. unit
  52. integration
  53. spm
  54. Optionally, reads the environment variable SANITIZERS. If set, it is expected to
  55. be a string containing a space-separated list with some of the following
  56. elements:
  57. asan
  58. tsan
  59. ubsan
  60. EOF
  61. exit 1
  62. fi
  63. product="$1"
  64. platform="iOS"
  65. if [[ $# -gt 1 ]]; then
  66. platform="$2"
  67. fi
  68. method="xcodebuild"
  69. if [[ $# -gt 2 ]]; then
  70. method="$3"
  71. fi
  72. echo "Building $product for $platform using $method"
  73. if [[ -n "${SANITIZERS:-}" ]]; then
  74. echo "Using sanitizers: $SANITIZERS"
  75. fi
  76. if [[ -n "${CUSTOM_FIRESTORE_PROJECT_ID:-}" ]]; then
  77. echo "Using firestore staging project: $CUSTOM_FIRESTORE_PROJECT_ID"
  78. fi
  79. scripts_dir=$(dirname "${BASH_SOURCE[0]}")
  80. firestore_emulator="${scripts_dir}/run_firestore_emulator.sh"
  81. database_emulator="${scripts_dir}/run_database_emulator.sh"
  82. system=$(uname -s)
  83. case "$system" in
  84. Darwin)
  85. xcode_version=$(xcodebuild -version | head -n 1)
  86. xcode_version="${xcode_version/Xcode /}"
  87. xcode_major="${xcode_version/.*/}"
  88. ;;
  89. *)
  90. xcode_major="0"
  91. ;;
  92. esac
  93. # Source function to check if CI secrets are available.
  94. source scripts/check_secrets.sh
  95. # Runs xcodebuild with the given flags, piping output to xcpretty
  96. # If xcodebuild fails with known error codes, retries once.
  97. function RunXcodebuild() {
  98. echo xcodebuild "$@"
  99. xcpretty_cmd=(xcpretty)
  100. if [[ -n "${TRAVIS:-}" ]]; then
  101. # The formatter argument takes a file location of a formatter.
  102. # The xcpretty-travis-formatter binary prints its location on stdout.
  103. xcpretty_cmd+=(-f $(xcpretty-travis-formatter))
  104. fi
  105. result=0
  106. xcodebuild "$@" | tee xcodebuild.log | "${xcpretty_cmd[@]}" || result=$?
  107. if [[ $result == 65 ]]; then
  108. ExportLogs "$@"
  109. echo "xcodebuild exited with 65, retrying" 1>&2
  110. sleep 5
  111. result=0
  112. xcodebuild "$@" | tee xcodebuild.log | "${xcpretty_cmd[@]}" || result=$?
  113. fi
  114. if [[ $result != 0 ]]; then
  115. echo "xcodebuild exited with $result" 1>&2
  116. ExportLogs "$@"
  117. return $result
  118. fi
  119. }
  120. # Exports any logs output captured in the xcresult
  121. function ExportLogs() {
  122. python "${scripts_dir}/xcresult_logs.py" "$@"
  123. }
  124. if [[ "$xcode_major" -lt 11 ]]; then
  125. ios_flags=(
  126. -sdk 'iphonesimulator'
  127. -destination 'platform=iOS Simulator,name=iPhone 7'
  128. )
  129. else
  130. ios_flags=(
  131. -sdk 'iphonesimulator'
  132. -destination 'platform=iOS Simulator,name=iPhone 11'
  133. )
  134. fi
  135. ios_device_flags=(
  136. -sdk 'iphoneos'
  137. -destination 'generic/platform=iOS'
  138. )
  139. ipad_flags=(
  140. -sdk 'iphonesimulator'
  141. -destination 'platform=iOS Simulator,name=iPad Pro (9.7-inch)'
  142. )
  143. macos_flags=(
  144. -sdk 'macosx'
  145. -destination 'platform=OS X,arch=x86_64'
  146. )
  147. tvos_flags=(
  148. -sdk "appletvsimulator"
  149. -destination 'platform=tvOS Simulator,name=Apple TV'
  150. )
  151. watchos_flags=(
  152. -destination 'platform=iOS Simulator,name=iPhone 11 Pro'
  153. )
  154. catalyst_flags=(
  155. ARCHS=x86_64 VALID_ARCHS=x86_64 SUPPORTS_MACCATALYST=YES -sdk macosx
  156. -destination platform="macOS,variant=Mac Catalyst" TARGETED_DEVICE_FAMILY=2
  157. CODE_SIGN_IDENTITY=- CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  158. )
  159. # Compute standard flags for all platforms
  160. case "$platform" in
  161. iOS)
  162. xcb_flags=("${ios_flags[@]}")
  163. gen_platform=ios
  164. ;;
  165. iOS-device)
  166. xcb_flags=("${ios_device_flags[@]}")
  167. gen_platform=ios
  168. ;;
  169. iPad)
  170. xcb_flags=("${ipad_flags[@]}")
  171. ;;
  172. macOS)
  173. xcb_flags=("${macos_flags[@]}")
  174. gen_platform=macos
  175. ;;
  176. tvOS)
  177. xcb_flags=("${tvos_flags[@]}")
  178. gen_platform=tvos
  179. ;;
  180. watchOS)
  181. xcb_flags=("${watchos_flags[@]}")
  182. ;;
  183. catalyst)
  184. xcb_flags=("${catalyst_flags[@]}")
  185. ;;
  186. all)
  187. xcb_flags=()
  188. ;;
  189. Linux)
  190. xcb_flags=()
  191. ;;
  192. *)
  193. echo "Unknown platform '$platform'" 1>&2
  194. exit 1
  195. ;;
  196. esac
  197. xcb_flags+=(
  198. ONLY_ACTIVE_ARCH=YES
  199. CODE_SIGNING_REQUIRED=NO
  200. CODE_SIGNING_ALLOWED=YES
  201. COMPILER_INDEX_STORE_ENABLE=NO
  202. )
  203. source scripts/buildcache.sh
  204. xcb_flags=("${xcb_flags[@]}" "${buildcache_xcb_flags[@]}")
  205. # TODO(varconst): Add --warn-unused-vars and --warn-uninitialized.
  206. # Right now, it makes the log overflow on Travis because many of our
  207. # dependencies don't build cleanly this way.
  208. cmake_options=(
  209. -Wdeprecated
  210. -DCMAKE_BUILD_TYPE=Debug
  211. )
  212. if [[ -n "${SANITIZERS:-}" ]]; then
  213. for sanitizer in $SANITIZERS; do
  214. case "$sanitizer" in
  215. asan)
  216. xcb_flags+=(
  217. -enableAddressSanitizer YES
  218. )
  219. cmake_options+=(
  220. -DWITH_ASAN=ON
  221. )
  222. ;;
  223. tsan)
  224. xcb_flags+=(
  225. -enableThreadSanitizer YES
  226. )
  227. cmake_options+=(
  228. -DWITH_TSAN=ON
  229. )
  230. ;;
  231. ubsan)
  232. xcb_flags+=(
  233. -enableUndefinedBehaviorSanitizer YES
  234. )
  235. cmake_options+=(
  236. -DWITH_UBSAN=ON
  237. )
  238. ;;
  239. *)
  240. echo "Unknown sanitizer '$sanitizer'" 1>&2
  241. exit 1
  242. ;;
  243. esac
  244. done
  245. fi
  246. case "$product-$platform-$method" in
  247. FirebasePod-iOS-*)
  248. RunXcodebuild \
  249. -workspace 'CoreOnly/Tests/FirebasePodTest/FirebasePodTest.xcworkspace' \
  250. -scheme "FirebasePodTest" \
  251. "${xcb_flags[@]}" \
  252. build
  253. ;;
  254. Auth-*-xcodebuild)
  255. if check_secrets; then
  256. RunXcodebuild \
  257. -workspace 'FirebaseAuth/Tests/Sample/AuthSample.xcworkspace' \
  258. -scheme "Auth_ApiTests" \
  259. "${xcb_flags[@]}" \
  260. build \
  261. test
  262. RunXcodebuild \
  263. -workspace 'FirebaseAuth/Tests/Sample/AuthSample.xcworkspace' \
  264. -scheme "SwiftApiTests" \
  265. "${xcb_flags[@]}" \
  266. build \
  267. test
  268. fi
  269. ;;
  270. CombineSwift-*-xcodebuild)
  271. pod_gen FirebaseCombineSwift.podspec --platforms=ios
  272. RunXcodebuild \
  273. -workspace 'gen/FirebaseCombineSwift/FirebaseCombineSwift.xcworkspace' \
  274. -scheme "FirebaseCombineSwift-Unit-unit" \
  275. "${xcb_flags[@]}" \
  276. build \
  277. test
  278. ;;
  279. InAppMessaging-*-xcodebuild)
  280. RunXcodebuild \
  281. -workspace 'FirebaseInAppMessaging/Tests/Integration/DefaultUITestApp/InAppMessagingDisplay-Sample.xcworkspace' \
  282. -scheme 'FiamDisplaySwiftExample' \
  283. "${xcb_flags[@]}" \
  284. build \
  285. test
  286. ;;
  287. Firestore-*-xcodebuild)
  288. "${firestore_emulator}" start
  289. trap '"${firestore_emulator}" stop' ERR EXIT
  290. RunXcodebuild \
  291. -workspace 'Firestore/Example/Firestore.xcworkspace' \
  292. -scheme "Firestore_IntegrationTests_$platform" \
  293. -enableCodeCoverage YES \
  294. "${xcb_flags[@]}" \
  295. build \
  296. test
  297. ;;
  298. Firestore-macOS-cmake | Firestore-Linux-cmake)
  299. "${firestore_emulator}" start
  300. trap '"${firestore_emulator}" stop' ERR EXIT
  301. (
  302. test -d build || mkdir build
  303. cd build
  304. echo "Preparing cmake build ..."
  305. cmake -G Ninja "${cmake_options[@]}" ..
  306. echo "Building cmake build ..."
  307. ninja -k 10 all
  308. ctest --verbose
  309. )
  310. ;;
  311. SymbolCollision-*-*)
  312. RunXcodebuild \
  313. -workspace 'SymbolCollisionTest/SymbolCollisionTest.xcworkspace' \
  314. -scheme "SymbolCollisionTest" \
  315. "${xcb_flags[@]}" \
  316. build
  317. ;;
  318. Messaging-*-xcodebuild)
  319. pod_gen FirebaseMessaging.podspec --platforms=ios
  320. # Add GoogleService-Info.plist to generated Test Wrapper App.
  321. ruby ./scripts/update_xcode_target.rb gen/FirebaseMessaging/Pods/Pods.xcodeproj \
  322. AppHost-FirebaseMessaging-Unit-Tests \
  323. ../../../FirebaseMessaging/Tests/IntegrationTests/Resources/GoogleService-Info.plist
  324. RunXcodebuild \
  325. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  326. -scheme "FirebaseMessaging-Unit-unit" \
  327. "${ios_flags[@]}" \
  328. "${xcb_flags[@]}" \
  329. build \
  330. test
  331. if check_secrets; then
  332. # Integration tests are only run on iOS to minimize flake failures.
  333. RunXcodebuild \
  334. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  335. -scheme "FirebaseMessaging-Unit-integration" \
  336. "${ios_flags[@]}" \
  337. "${xcb_flags[@]}" \
  338. build \
  339. test
  340. fi
  341. pod_gen FirebaseMessaging.podspec --platforms=macos --clean
  342. RunXcodebuild \
  343. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  344. -scheme "FirebaseMessaging-Unit-unit" \
  345. "${macos_flags[@]}" \
  346. "${xcb_flags[@]}" \
  347. build \
  348. test
  349. pod_gen FirebaseMessaging.podspec --platforms=tvos --clean
  350. RunXcodebuild \
  351. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  352. -scheme "FirebaseMessaging-Unit-unit" \
  353. "${tvos_flags[@]}" \
  354. "${xcb_flags[@]}" \
  355. build \
  356. test
  357. ;;
  358. MessagingSample-*-*)
  359. if check_secrets; then
  360. RunXcodebuild \
  361. -workspace 'FirebaseMessaging/Apps/Sample/Sample.xcworkspace' \
  362. -scheme "Sample" \
  363. "${xcb_flags[@]}" \
  364. build
  365. fi
  366. ;;
  367. SwiftUISample-*-*)
  368. if check_secrets; then
  369. RunXcodebuild \
  370. -workspace 'FirebaseMessaging/Apps/SwiftUISample/SwiftUISample.xcworkspace' \
  371. -scheme "SwiftUISample" \
  372. "${xcb_flags[@]}" \
  373. build
  374. fi
  375. ;;
  376. MLModelDownloaderSample-*-*)
  377. if check_secrets; then
  378. RunXcodebuild \
  379. -workspace 'FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp.xcworkspace' \
  380. -scheme "MLDownloaderTestApp" \
  381. "${xcb_flags[@]}" \
  382. build
  383. fi
  384. ;;
  385. WatchOSSample-*-*)
  386. RunXcodebuild \
  387. -workspace 'Example/watchOSSample/SampleWatchApp.xcworkspace' \
  388. -scheme "SampleWatchAppWatchKitApp" \
  389. "${xcb_flags[@]}" \
  390. build
  391. ;;
  392. Database-*-unit)
  393. pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}"
  394. RunXcodebuild \
  395. -workspace 'gen/FirebaseDatabase/FirebaseDatabase.xcworkspace' \
  396. -scheme "FirebaseDatabase-Unit-unit" \
  397. "${xcb_flags[@]}" \
  398. build \
  399. test
  400. ;;
  401. Database-*-integration)
  402. "${database_emulator}" start
  403. trap '"${database_emulator}" stop' ERR EXIT
  404. pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}"
  405. RunXcodebuild \
  406. -workspace 'gen/FirebaseDatabase/FirebaseDatabase.xcworkspace' \
  407. -scheme "FirebaseDatabase-Unit-integration" \
  408. "${xcb_flags[@]}" \
  409. build \
  410. test
  411. ;;
  412. RemoteConfig-*-fakeconsole)
  413. pod_gen FirebaseRemoteConfigSwift.podspec --platforms="${gen_platform}"
  414. RunXcodebuild \
  415. -workspace 'gen/FirebaseRemoteConfigSwift/FirebaseRemoteConfigSwift.xcworkspace' \
  416. -scheme "FirebaseRemoteConfigSwift-Unit-fake-console-tests" \
  417. "${xcb_flags[@]}" \
  418. build \
  419. test
  420. ;;
  421. RemoteConfig-*-integration)
  422. pod_gen FirebaseRemoteConfigSwift.podspec --platforms="${gen_platform}"
  423. # Add GoogleService-Info.plist to generated Test Wrapper App.
  424. ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfigSwift/Pods/Pods.xcodeproj \
  425. AppHost-FirebaseRemoteConfigSwift-Unit-Tests \
  426. ../../../FirebaseRemoteConfigSwift/Tests/SwiftAPI/GoogleService-Info.plist
  427. # Add AccessToken to generated Test Wrapper App.
  428. ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfigSwift/Pods/Pods.xcodeproj \
  429. AppHost-FirebaseRemoteConfigSwift-Unit-Tests \
  430. ../../../FirebaseRemoteConfigSwift/Tests/AccessToken.json
  431. RunXcodebuild \
  432. -workspace 'gen/FirebaseRemoteConfigSwift/FirebaseRemoteConfigSwift.xcworkspace' \
  433. -scheme "FirebaseRemoteConfigSwift-Unit-swift-api-tests" \
  434. "${xcb_flags[@]}" \
  435. build \
  436. test
  437. ;;
  438. RemoteConfigSample-*-*)
  439. RunXcodebuild \
  440. -workspace 'FirebaseRemoteConfig/Tests/Sample/RemoteConfigSampleApp.xcworkspace' \
  441. -scheme "RemoteConfigSampleApp" \
  442. "${xcb_flags[@]}" \
  443. build
  444. ;;
  445. Storage-*-xcodebuild)
  446. pod_gen FirebaseStorage.podspec --platforms=ios
  447. # Add GoogleService-Info.plist to generated Test Wrapper App.
  448. ruby ./scripts/update_xcode_target.rb gen/FirebaseStorage/Pods/Pods.xcodeproj \
  449. AppHost-FirebaseStorage-Unit-Tests \
  450. ../../../FirebaseStorageInternal/Tests/Integration/Resources/GoogleService-Info.plist
  451. if check_secrets; then
  452. # Integration tests are only run on iOS to minimize flake failures.
  453. RunXcodebuild \
  454. -workspace 'gen/FirebaseStorage/FirebaseStorage.xcworkspace' \
  455. -scheme "FirebaseStorage-Unit-integration" \
  456. "${ios_flags[@]}" \
  457. "${xcb_flags[@]}" \
  458. build \
  459. test
  460. fi
  461. if check_secrets; then
  462. # Integration tests are only run on iOS to minimize flake failures.
  463. RunXcodebuild \
  464. -workspace 'gen/FirebaseStorage/FirebaseStorage.xcworkspace' \
  465. -scheme "FirebaseStorage-Unit-ObjCIntegration" \
  466. "${ios_flags[@]}" \
  467. "${xcb_flags[@]}" \
  468. build \
  469. test
  470. fi
  471. ;;
  472. StorageCombine-*-xcodebuild)
  473. pod_gen FirebaseCombineSwift.podspec --platforms=ios
  474. # Add GoogleService-Info.plist to generated Test Wrapper App.
  475. ruby ./scripts/update_xcode_target.rb gen/FirebaseCombineSwift/Pods/Pods.xcodeproj \
  476. AppHost-FirebaseCombineSwift-Unit-Tests \
  477. ../../../FirebaseStorageInternal/Tests/Integration/Resources/GoogleService-Info.plist
  478. if check_secrets; then
  479. # Integration tests are only run on iOS to minimize flake failures.
  480. RunXcodebuild \
  481. -workspace 'gen/FirebaseCombineSwift/FirebaseCombineSwift.xcworkspace' \
  482. -scheme "FirebaseCombineSwift-Unit-integration" \
  483. "${ios_flags[@]}" \
  484. "${xcb_flags[@]}" \
  485. build \
  486. test
  487. fi
  488. ;;
  489. GoogleDataTransport-watchOS-xcodebuild)
  490. RunXcodebuild \
  491. -workspace 'GoogleDataTransport/GDTWatchOSTestApp/GDTWatchOSTestApp.xcworkspace' \
  492. -scheme "GDTWatchOSTestAppWatchKitApp" \
  493. "${xcb_flags[@]}" \
  494. build
  495. RunXcodebuild \
  496. -workspace 'GoogleDataTransport/GDTCCTWatchOSTestApp/GDTCCTWatchOSTestApp.xcworkspace' \
  497. -scheme "GDTCCTWatchOSIndependentTestAppWatchKitApp" \
  498. "${xcb_flags[@]}" \
  499. build
  500. RunXcodebuild \
  501. -workspace 'GoogleDataTransport/GDTCCTWatchOSTestApp/GDTCCTWatchOSTestApp.xcworkspace' \
  502. -scheme "GDTCCTWatchOSCompanionTestApp" \
  503. "${xcb_flags[@]}" \
  504. build
  505. ;;
  506. Performance-*-unit)
  507. # Run unit tests on prod environment with unswizzle capabilities.
  508. export FPR_UNSWIZZLE_AVAILABLE="1"
  509. export FPR_AUTOPUSH_ENV="0"
  510. pod_gen FirebasePerformance.podspec --platforms="${gen_platform}"
  511. RunXcodebuild \
  512. -workspace 'gen/FirebasePerformance/FirebasePerformance.xcworkspace' \
  513. -scheme "FirebasePerformance-Unit-unit" \
  514. "${xcb_flags[@]}" \
  515. build \
  516. test
  517. ;;
  518. Performance-*-proddev)
  519. # Build the prod dev test app.
  520. export FPR_UNSWIZZLE_AVAILABLE="0"
  521. export FPR_AUTOPUSH_ENV="0"
  522. pod_gen FirebasePerformance.podspec --platforms="${gen_platform}"
  523. RunXcodebuild \
  524. -workspace 'gen/FirebasePerformance/FirebasePerformance.xcworkspace' \
  525. -scheme "FirebasePerformance-TestApp" \
  526. "${xcb_flags[@]}" \
  527. build
  528. ;;
  529. Performance-*-integration)
  530. # Generate the workspace for the SDK to generate Protobuf files.
  531. export FPR_UNSWIZZLE_AVAILABLE="0"
  532. pod_gen FirebasePerformance.podspec --platforms=ios --clean
  533. # Perform "pod install" to install the relevant dependencies
  534. cd FirebasePerformance/Tests/FIRPerfE2E; pod install; cd -
  535. # Run E2E Integration Tests for Autopush.
  536. RunXcodebuild \
  537. -workspace 'FirebasePerformance/Tests/FIRPerfE2E/FIRPerfE2E.xcworkspace' \
  538. -scheme "FIRPerfE2EAutopush" \
  539. FPR_AUTOPUSH_ENV=1 \
  540. "${ios_flags[@]}" \
  541. "${xcb_flags[@]}" \
  542. build \
  543. test
  544. # Run E2E Integration Tests for Prod.
  545. RunXcodebuild \
  546. -workspace 'FirebasePerformance/Tests/FIRPerfE2E/FIRPerfE2E.xcworkspace' \
  547. -scheme "FIRPerfE2EProd" \
  548. "${ios_flags[@]}" \
  549. "${xcb_flags[@]}" \
  550. build \
  551. test
  552. ;;
  553. # Note that the combine tests require setting the minimum iOS and tvOS version to 13.0
  554. *-*-spm)
  555. RunXcodebuild \
  556. -scheme $product \
  557. "${xcb_flags[@]}" \
  558. IPHONEOS_DEPLOYMENT_TARGET=13.0 \
  559. TVOS_DEPLOYMENT_TARGET=13.0 \
  560. test
  561. ;;
  562. *-*-spmbuildonly)
  563. RunXcodebuild \
  564. -scheme $product \
  565. "${xcb_flags[@]}" \
  566. build
  567. ;;
  568. *)
  569. echo "Don't know how to build this product-platform-method combination" 1>&2
  570. echo " product=$product" 1>&2
  571. echo " platform=$platform" 1>&2
  572. echo " method=$method" 1>&2
  573. exit 1
  574. ;;
  575. esac