build.sh 17 KB

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