Skip to content

Commit

Permalink
Fix ci script for Xcode 12
Browse files Browse the repository at this point in the history
  • Loading branch information
kenji21 committed Nov 26, 2020
1 parent e4bc3b5 commit 81faad1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function xcode_major() {
echo "$XCODE_MAJOR"
}

function is_xcode_version_11_plus() {
if [[ `xcode_version` -ge 11 ]]; then
function is_xcode_version_above() {
if [[ `xcode_major` -ge $1 ]]; then
return 0
else
return 1
Expand All @@ -32,16 +32,18 @@ env NSUnbufferedIO=YES xcodebuild test -project KIF.xcodeproj -derivedDataPath=$
env NSUnbufferedIO=YES xcodebuild test -project KIF.xcodeproj -scheme KIF -derivedDataPath=${PWD}/build/KIF -destination "platform=iOS Simulator,${SIMULATOR}" | xcpretty -c

# Due to unstable Swift language syntax, this only compiles on Xcode 8+
if is_xcode_version_11_plus; then
if is_xcode_version_above 11 ; then
env NSUnbufferedIO=YES xcodebuild test -project "Documentation/Examples/Testable Swift/Testable Swift.xcodeproj" -scheme "Testable Swift" -derivedDataPath=${PWD}/build/TestableSwift -destination "platform=iOS Simulator,${SIMULATOR}" | xcpretty -c
fi

env NSUnbufferedIO=YES xcodebuild test -project "Documentation/Examples/Testable/Testable.xcodeproj" -scheme Testable -derivedDataPath=${PWD}/build/Testable -destination "platform=iOS Simulator,${SIMULATOR}" | xcpretty -c
# For some reason, attempting to run the Calculator tests on Xcode 7 causes a frequent crash in CI
env NSUnbufferedIO=YES xcodebuild build -project "Documentation/Examples/Calculator/Calculator.xcodeproj" -scheme "Calculator" -derivedDataPath=${PWD}/build/Calculator -destination "platform=iOS Simulator,${SIMULATOR}" | xcpretty -c

carthage build --no-skip-current
carthage archive KIF
if ! is_xcode_version_above 12 ; then # see https://github.com/Carthage/Carthage/issues/3019 for Xcode 12 support
carthage build --no-skip-current
carthage archive KIF
fi

swift build -Xcc "-isysroot" -Xcc "$(xcrun --sdk iphonesimulator --show-sdk-path)" -Xcc "-target" -Xcc "x86_64-apple-ios$(xcrun --sdk iphonesimulator --show-sdk-version)-simulator"

0 comments on commit 81faad1

Please sign in to comment.