build.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  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. # TODO(varconst): Add --warn-unused-vars and --warn-uninitialized.
  201. # Right now, it makes the log overflow on Travis because many of our
  202. # dependencies don't build cleanly this way.
  203. cmake_options=(
  204. -Wdeprecated
  205. -DCMAKE_BUILD_TYPE=Debug
  206. )
  207. if [[ -n "${SANITIZERS:-}" ]]; then
  208. for sanitizer in $SANITIZERS; do
  209. case "$sanitizer" in
  210. asan)
  211. xcb_flags+=(
  212. -enableAddressSanitizer YES
  213. )
  214. cmake_options+=(
  215. -DWITH_ASAN=ON
  216. )
  217. ;;
  218. tsan)
  219. xcb_flags+=(
  220. -enableThreadSanitizer YES
  221. )
  222. cmake_options+=(
  223. -DWITH_TSAN=ON
  224. )
  225. ;;
  226. ubsan)
  227. xcb_flags+=(
  228. -enableUndefinedBehaviorSanitizer YES
  229. )
  230. cmake_options+=(
  231. -DWITH_UBSAN=ON
  232. )
  233. ;;
  234. *)
  235. echo "Unknown sanitizer '$sanitizer'" 1>&2
  236. exit 1
  237. ;;
  238. esac
  239. done
  240. fi
  241. case "$product-$platform-$method" in
  242. FirebasePod-iOS-*)
  243. RunXcodebuild \
  244. -workspace 'CoreOnly/Tests/FirebasePodTest/FirebasePodTest.xcworkspace' \
  245. -scheme "FirebasePodTest" \
  246. "${xcb_flags[@]}" \
  247. build
  248. ;;
  249. Auth-*-xcodebuild)
  250. if check_secrets; then
  251. RunXcodebuild \
  252. -workspace 'FirebaseAuth/Tests/Sample/AuthSample.xcworkspace' \
  253. -scheme "Auth_ApiTests" \
  254. "${xcb_flags[@]}" \
  255. build \
  256. test
  257. RunXcodebuild \
  258. -workspace 'FirebaseAuth/Tests/Sample/AuthSample.xcworkspace' \
  259. -scheme "SwiftApiTests" \
  260. "${xcb_flags[@]}" \
  261. build \
  262. test
  263. fi
  264. ;;
  265. CombineSwift-*-xcodebuild)
  266. pod_gen FirebaseCombineSwift.podspec --platforms=ios
  267. RunXcodebuild \
  268. -workspace 'gen/FirebaseCombineSwift/FirebaseCombineSwift.xcworkspace' \
  269. -scheme "FirebaseCombineSwift-Unit-unit" \
  270. "${xcb_flags[@]}" \
  271. build \
  272. test
  273. ;;
  274. InAppMessaging-*-xcodebuild)
  275. RunXcodebuild \
  276. -workspace 'FirebaseInAppMessaging/Tests/Integration/DefaultUITestApp/InAppMessagingDisplay-Sample.xcworkspace' \
  277. -scheme 'FiamDisplaySwiftExample' \
  278. "${xcb_flags[@]}" \
  279. build \
  280. test
  281. ;;
  282. Firestore-*-xcodebuild)
  283. "${firestore_emulator}" start
  284. trap '"${firestore_emulator}" stop' ERR EXIT
  285. RunXcodebuild \
  286. -workspace 'Firestore/Example/Firestore.xcworkspace' \
  287. -scheme "Firestore_IntegrationTests_$platform" \
  288. -enableCodeCoverage YES \
  289. "${xcb_flags[@]}" \
  290. build \
  291. test
  292. ;;
  293. Firestore-macOS-cmake | Firestore-Linux-cmake)
  294. "${firestore_emulator}" start
  295. trap '"${firestore_emulator}" stop' ERR EXIT
  296. (
  297. test -d build || mkdir build
  298. cd build
  299. echo "Preparing cmake build ..."
  300. cmake -G Ninja "${cmake_options[@]}" ..
  301. echo "Building cmake build ..."
  302. ninja -k 10 all
  303. ctest --output-on-failure
  304. )
  305. ;;
  306. SymbolCollision-*-*)
  307. RunXcodebuild \
  308. -workspace 'SymbolCollisionTest/SymbolCollisionTest.xcworkspace' \
  309. -scheme "SymbolCollisionTest" \
  310. "${xcb_flags[@]}" \
  311. build
  312. ;;
  313. Messaging-*-xcodebuild)
  314. pod_gen FirebaseMessaging.podspec --platforms=ios
  315. RunXcodebuild \
  316. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  317. -scheme "FirebaseMessaging-Unit-unit" \
  318. "${ios_flags[@]}" \
  319. "${xcb_flags[@]}" \
  320. build \
  321. test
  322. if check_secrets; then
  323. # Integration tests are only run on iOS to minimize flake failures.
  324. RunXcodebuild \
  325. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  326. -scheme "FirebaseMessaging-Unit-integration" \
  327. "${ios_flags[@]}" \
  328. "${xcb_flags[@]}" \
  329. build \
  330. test
  331. fi
  332. pod_gen FirebaseMessaging.podspec --platforms=macos --clean
  333. RunXcodebuild \
  334. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  335. -scheme "FirebaseMessaging-Unit-unit" \
  336. "${macos_flags[@]}" \
  337. "${xcb_flags[@]}" \
  338. build \
  339. test
  340. pod_gen FirebaseMessaging.podspec --platforms=tvos --clean
  341. RunXcodebuild \
  342. -workspace 'gen/FirebaseMessaging/FirebaseMessaging.xcworkspace' \
  343. -scheme "FirebaseMessaging-Unit-unit" \
  344. "${tvos_flags[@]}" \
  345. "${xcb_flags[@]}" \
  346. build \
  347. test
  348. ;;
  349. MessagingSample-*-*)
  350. if check_secrets; then
  351. RunXcodebuild \
  352. -workspace 'FirebaseMessaging/Apps/Sample/Sample.xcworkspace' \
  353. -scheme "Sample" \
  354. "${xcb_flags[@]}" \
  355. build
  356. fi
  357. ;;
  358. MLModelDownloaderSample-*-*)
  359. if check_secrets; then
  360. RunXcodebuild \
  361. -workspace 'FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp.xcworkspace' \
  362. -scheme "MLDownloaderTestApp" \
  363. "${xcb_flags[@]}" \
  364. build
  365. fi
  366. ;;
  367. SegmentationSample-*-*)
  368. RunXcodebuild \
  369. -workspace 'FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcworkspace' \
  370. -scheme "SegmentationSampleApp" \
  371. "${xcb_flags[@]}" \
  372. build
  373. ;;
  374. WatchOSSample-*-*)
  375. RunXcodebuild \
  376. -workspace 'Example/watchOSSample/SampleWatchApp.xcworkspace' \
  377. -scheme "SampleWatchAppWatchKitApp" \
  378. "${xcb_flags[@]}" \
  379. build
  380. ;;
  381. Database-*-unit)
  382. pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}"
  383. RunXcodebuild \
  384. -workspace 'gen/FirebaseDatabase/FirebaseDatabase.xcworkspace' \
  385. -scheme "FirebaseDatabase-Unit-unit" \
  386. "${xcb_flags[@]}" \
  387. build \
  388. test
  389. ;;
  390. Database-*-integration)
  391. "${database_emulator}" start
  392. trap '"${database_emulator}" stop' ERR EXIT
  393. pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}"
  394. RunXcodebuild \
  395. -workspace 'gen/FirebaseDatabase/FirebaseDatabase.xcworkspace' \
  396. -scheme "FirebaseDatabase-Unit-integration" \
  397. "${xcb_flags[@]}" \
  398. build \
  399. test
  400. ;;
  401. RemoteConfig-*-unit)
  402. pod_gen FirebaseRemoteConfig.podspec --platforms="${gen_platform}"
  403. RunXcodebuild \
  404. -workspace 'gen/FirebaseRemoteConfig/FirebaseRemoteConfig.xcworkspace' \
  405. -scheme "FirebaseRemoteConfig-Unit-unit" \
  406. "${xcb_flags[@]}" \
  407. build \
  408. test
  409. ;;
  410. RemoteConfig-*-fakeconsole)
  411. pod_gen FirebaseRemoteConfig.podspec --platforms="${gen_platform}"
  412. # Add GoogleService-Info.plist to generated Test Wrapper App.
  413. ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfig/Pods/Pods.xcodeproj \
  414. AppHost-FirebaseRemoteConfig-Unit-Tests \
  415. ../../../FirebaseRemoteConfig/Tests/FakeUtils/GoogleService-Info.plist
  416. RunXcodebuild \
  417. -workspace 'gen/FirebaseRemoteConfig/FirebaseRemoteConfig.xcworkspace' \
  418. -scheme "FirebaseRemoteConfig-Unit-fake-console-tests" \
  419. "${xcb_flags[@]}" \
  420. build \
  421. test
  422. ;;
  423. RemoteConfig-*-integration)
  424. pod_gen FirebaseRemoteConfig.podspec --platforms="${gen_platform}"
  425. # Add GoogleService-Info.plist to generated Test Wrapper App.
  426. ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfig/Pods/Pods.xcodeproj \
  427. AppHost-FirebaseRemoteConfig-Unit-Tests \
  428. ../../../FirebaseRemoteConfig/Tests/SwiftAPI/GoogleService-Info.plist
  429. # Add AccessToken to generated Test Wrapper App.
  430. ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfig/Pods/Pods.xcodeproj \
  431. AppHost-FirebaseRemoteConfig-Unit-Tests \
  432. ../../../FirebaseRemoteConfig/Tests/SwiftAPI/AccessToken.json
  433. RunXcodebuild \
  434. -workspace 'gen/FirebaseRemoteConfig/FirebaseRemoteConfig.xcworkspace' \
  435. -scheme "FirebaseRemoteConfig-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. Storage-*-xcodebuild)
  448. pod_gen FirebaseStorage.podspec --platforms=ios
  449. # Add GoogleService-Info.plist to generated Test Wrapper App.
  450. ruby ./scripts/update_xcode_target.rb gen/FirebaseStorage/Pods/Pods.xcodeproj \
  451. AppHost-FirebaseStorage-Unit-Tests \
  452. ../../../FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist
  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-integration" \
  458. "${ios_flags[@]}" \
  459. "${xcb_flags[@]}" \
  460. build \
  461. test
  462. RunXcodebuild \
  463. -workspace 'gen/FirebaseStorage/FirebaseStorage.xcworkspace' \
  464. -scheme "FirebaseStorage-Unit-swift-integration" \
  465. "${ios_flags[@]}" \
  466. "${xcb_flags[@]}" \
  467. build \
  468. test
  469. fi
  470. ;;
  471. StorageSwift-*-xcodebuild)
  472. pod_gen FirebaseStorageSwift.podspec --platforms=ios
  473. # Add GoogleService-Info.plist to generated Test Wrapper App.
  474. ruby ./scripts/update_xcode_target.rb gen/FirebaseStorageSwift/Pods/Pods.xcodeproj \
  475. AppHost-FirebaseStorageSwift-Unit-Tests \
  476. ../../../FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist
  477. if check_secrets; then
  478. # Integration tests are only run on iOS to minimize flake failures.
  479. RunXcodebuild \
  480. -workspace 'gen/FirebaseStorageSwift/FirebaseStorageSwift.xcworkspace' \
  481. -scheme "FirebaseStorageSwift-Unit-integration" \
  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