build.sh 18 KB

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