From 13fbf84402f4e9f68f2b99c46e601f508bfecae3 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Wed, 11 Sep 2019 01:25:19 +0900 Subject: [PATCH] Fix device builds for iOS and tvOS --- .../CwlPreconditionTesting/CwlBadInstructionException.swift | 2 +- .../CwlPreconditionTesting/CwlCatchBadInstruction.swift | 2 +- .../CwlPreconditionTesting/CwlCatchBadInstructionPosix.swift | 2 +- .../Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift | 2 +- test | 4 ++++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlBadInstructionException.swift b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlBadInstructionException.swift index d77eae3f4..90ee022b1 100644 --- a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlBadInstructionException.swift +++ b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlBadInstructionException.swift @@ -18,7 +18,7 @@ // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // -#if os(macOS) || os(iOS) +#if (os(macOS) || os(iOS)) && arch(x86_64) import Foundation diff --git a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstruction.swift b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstruction.swift index 51ffa9fe9..521b2a110 100644 --- a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstruction.swift +++ b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstruction.swift @@ -18,7 +18,7 @@ // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // -#if os(macOS) || os(iOS) +#if (os(macOS) || os(iOS)) && arch(x86_64) import Foundation import Swift diff --git a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstructionPosix.swift b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstructionPosix.swift index af6eb102a..4fc99faad 100644 --- a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstructionPosix.swift +++ b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstructionPosix.swift @@ -18,7 +18,7 @@ // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // -#if os(tvOS) +#if os(tvOS) && targetEnvironment(simulator) import Foundation diff --git a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift index 78f571704..f22ed1f1c 100644 --- a/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift +++ b/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift @@ -18,7 +18,7 @@ // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // -#if os(macOS) || os(iOS) +#if (os(macOS) || os(iOS)) && arch(x86_64) import Darwin diff --git a/test b/test index e406ecc5c..3c17d810d 100755 --- a/test +++ b/test @@ -54,6 +54,8 @@ function run { } function test_ios { + run set -o pipefail && xcodebuild -project Nimble.xcodeproj -scheme "Nimble-iOS" -configuration "Debug" -destination "generic/platform=iOS" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build | xcpretty + run osascript -e 'tell app "Simulator" to quit' run set -o pipefail && xcodebuild -project Nimble.xcodeproj -scheme "Nimble-iOS" -configuration "Debug" -sdk "iphonesimulator$BUILD_IOS_SDK_VERSION" -destination "name=iPad Pro (11-inch),OS=$RUNTIME_IOS_SDK_VERSION" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build-for-testing test-without-building | xcpretty @@ -62,6 +64,8 @@ function test_ios { } function test_tvos { + run set -o pipefail && xcodebuild -project Nimble.xcodeproj -scheme "Nimble-tvOS" -configuration "Debug" -destination "generic/platform=tvOS" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build | xcpretty + run osascript -e 'tell app "Simulator" to quit' run set -o pipefail && xcodebuild -project Nimble.xcodeproj -scheme "Nimble-tvOS" -configuration "Debug" -sdk "appletvsimulator$BUILD_TVOS_SDK_VERSION" -destination "name=Apple TV,OS=$RUNTIME_TVOS_SDK_VERSION" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build-for-testing test-without-building | xcpretty }