build.sh 18 KB

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