diff --git a/Package.swift b/Package.swift index f4d666920..811014a69 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 import PackageDescription let package = Package( @@ -15,16 +15,12 @@ let package = Package( targets: [ .target( name: "Nimble", - dependencies: { - #if os(macOS) - return [ - "CwlPreconditionTesting", - .product(name: "CwlPosixPreconditionTesting", package: "CwlPreconditionTesting") - ] - #else - return [] - #endif - }() + dependencies: [ + .product(name: "CwlPreconditionTesting", package: "CwlPreconditionTesting", + condition: .when(platforms: [.macOS, .iOS])), + .product(name: "CwlPosixPreconditionTesting", package: "CwlPreconditionTesting", + condition: .when(platforms: [.tvOS])) + ] ), .testTarget( name: "NimbleTests", diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift new file mode 100644 index 000000000..f4d666920 --- /dev/null +++ b/Package@swift-5.2.swift @@ -0,0 +1,36 @@ +// swift-tools-version:5.2 +import PackageDescription + +let package = Package( + name: "Nimble", + platforms: [ + .macOS(.v10_10), .iOS(.v9), .tvOS(.v9) + ], + products: [ + .library(name: "Nimble", targets: ["Nimble"]), + ], + dependencies: [ + .package(url: "https://github.com/mattgallagher/CwlPreconditionTesting.git", .upToNextMajor(from: "2.0.0")), + ], + targets: [ + .target( + name: "Nimble", + dependencies: { + #if os(macOS) + return [ + "CwlPreconditionTesting", + .product(name: "CwlPosixPreconditionTesting", package: "CwlPreconditionTesting") + ] + #else + return [] + #endif + }() + ), + .testTarget( + name: "NimbleTests", + dependencies: ["Nimble"], + exclude: ["objc"] + ), + ], + swiftLanguageVersions: [.v5] +)