Skip to content

Commit

Permalink
do not break older Swift version support by creating a swift 5.9 expl…
Browse files Browse the repository at this point in the history
…icit Package.swift file
  • Loading branch information
stonko1994 committed Nov 3, 2023
1 parent 3720617 commit 78b4e76
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// swift-tools-version:5.9
// swift-tools-version:5.7
import PackageDescription

let package = Package(
name: "Nimble",
platforms: [
.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1)
.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)
],
products: [
.library(
Expand All @@ -19,8 +19,7 @@ let package = Package(
),
],
dependencies: [
// TODO: use official repo once merged
.package(url: "https://github.com/bitmovin-engineering/CwlPreconditionTesting.git", branch: "bitmovin/feature/visionos-support"),
.package(url: "https://github.com/mattgallagher/CwlPreconditionTesting.git", .upToNextMajor(from: "2.1.0")),
],
targets: {
var testHelperDependencies: [PackageDescription.Target.Dependency] = ["Nimble"]
Expand All @@ -32,7 +31,7 @@ let package = Package(
name: "Nimble",
dependencies: [
.product(name: "CwlPreconditionTesting", package: "CwlPreconditionTesting",
condition: .when(platforms: [.macOS, .iOS, .macCatalyst, .visionOS])),
condition: .when(platforms: [.macOS, .iOS, .macCatalyst])),
.product(name: "CwlPosixPreconditionTesting", package: "CwlPreconditionTesting",
condition: .when(platforms: [.tvOS, .watchOS]))
],
Expand Down
66 changes: 66 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// swift-tools-version:5.9
import PackageDescription

let package = Package(
name: "Nimble",
platforms: [
.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1)
],
products: [
.library(
name: "Nimble",
targets: {
var targets: [String] = ["Nimble"]
#if os(macOS)
targets.append("NimbleObjectiveC")
#endif
return targets
}()
),
],
dependencies: [
// TODO: use official repo once merged
.package(url: "https://github.com/bitmovin-engineering/CwlPreconditionTesting.git", branch: "bitmovin/feature/visionos-support"),
],
targets: {
var testHelperDependencies: [PackageDescription.Target.Dependency] = ["Nimble"]
#if os(macOS)
testHelperDependencies.append("NimbleObjectiveC")
#endif
var targets: [Target] = [
.target(
name: "Nimble",
dependencies: [
.product(name: "CwlPreconditionTesting", package: "CwlPreconditionTesting",
condition: .when(platforms: [.macOS, .iOS, .macCatalyst, .visionOS])),
.product(name: "CwlPosixPreconditionTesting", package: "CwlPreconditionTesting",
condition: .when(platforms: [.tvOS, .watchOS]))
],
exclude: ["Info.plist"]
),
.target(
name: "NimbleSharedTestHelpers",
dependencies: testHelperDependencies
),
.testTarget(
name: "NimbleTests",
dependencies: ["Nimble", "NimbleSharedTestHelpers"],
exclude: ["Info.plist"]
),
]
#if os(macOS)
targets.append(contentsOf: [
.target(
name: "NimbleObjectiveC",
dependencies: ["Nimble"]
),
.testTarget(
name: "NimbleObjectiveCTests",
dependencies: ["NimbleObjectiveC", "Nimble", "NimbleSharedTestHelpers"]
)
])
#endif
return targets
}(),
swiftLanguageVersions: [.v5]
)

0 comments on commit 78b4e76

Please sign in to comment.