forked from firebase/firebase-ios-sdk
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_catalyst.sh
executable file
·61 lines (52 loc) · 1.94 KB
/
test_catalyst.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# USAGE: test_catalyst.sh pod build_mode [scheme]
#
# Builds and run tests for Catalyst since it's not yet supported by
# `pod lib lint`.
# The second argument should be "build" or "test". "test" indicates both build
# and test.
# TODO - Determine why test specs that include `requires_app_host` fail to
# launch tests. Locally, they will pass if the only Objective C unit test scheme
# is specified. However, on GHA, they fail to launch both from the test scheme
# and the app scheme.
set -xeuo pipefail
pod="$1"
build_mode="$2"
if [[ $#-gt 2 ]];then
scheme="$3"
else
scheme="$pod"
fi
bundle exec pod gen --local-sources=./ --sources=https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/ \
"$pod".podspec --platforms=ios
args=(
# Build or test.
"$build_mode"
# Tests that require NSAssert's to fire need Debug.
"-configuration""Debug"
# The generated workspace.
"-workspace""gen/$pod/$pod.xcworkspace"
# Specify the app if all test should run. Otherwise, specify the test scheme.
"-scheme""$scheme"
# Specify Catalyst.
"ARCHS=x86_64h""VALID_ARCHS=x86_64h""SUPPORTS_MACCATALYST=YES"
# Run on macOS.
"-sdk""macosx""-destination platform=\"OS X\"""TARGETED_DEVICE_FAMILY=2"
# Disable signing.
"CODE_SIGN_IDENTITY=-""CODE_SIGNING_REQUIRED=NO""CODE_SIGNING_ALLOWED=NO"
)
xcodebuild -version
xcodebuild "${args[@]}"| xcpretty