build.sh 18 KB

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