mas/Package.swift

95 lines
3.4 KiB
Swift
Raw Normal View History

2021-04-26 23:44:17 +00:00
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "mas",
platforms: [
.macOS(.v10_11)
2021-04-26 23:44:17 +00:00
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.executable(
name: "mas",
targets: ["mas"]
),
.library(
name: "MasKit",
targets: ["MasKit"]
),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/Carthage/Commandant.git", from: "0.18.0"),
2022-09-22 01:39:11 +00:00
.package(url: "https://github.com/Quick/Nimble.git", from: "10.0.0"),
.package(url: "https://github.com/Quick/Quick.git", from: "5.0.0"),
2021-11-19 23:20:14 +00:00
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.16.2"),
.package(url: "https://github.com/mxcl/Version.git", from: "2.0.1"),
2021-04-26 23:44:17 +00:00
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "mas",
dependencies: ["MasKit"],
swiftSettings: [
.unsafeFlags([
"-I", "Sources/PrivateFrameworks/CommerceKit",
"-I", "Sources/PrivateFrameworks/StoreFoundation",
])
2021-04-26 23:44:17 +00:00
]
),
.target(
name: "MasKit",
2021-05-04 05:53:25 +00:00
dependencies: ["Commandant", "PromiseKit", "Version"],
2021-04-26 23:44:17 +00:00
swiftSettings: [
.unsafeFlags([
"-I", "Sources/PrivateFrameworks/CommerceKit",
"-I", "Sources/PrivateFrameworks/StoreFoundation",
])
2021-04-26 23:44:17 +00:00
],
linkerSettings: [
.linkedFramework("CommerceKit"),
.linkedFramework("StoreFoundation"),
.unsafeFlags(["-F", "/System/Library/PrivateFrameworks"]),
]
),
.testTarget(
name: "MasKitTests",
dependencies: ["MasKit", "Nimble", "Quick"],
resources: [.copy("JSON")],
swiftSettings: [
.unsafeFlags([
"-I", "Sources/PrivateFrameworks/CommerceKit",
"-I", "Sources/PrivateFrameworks/StoreFoundation",
])
2021-04-26 23:44:17 +00:00
]
),
],
swiftLanguageVersions: [.v5]
)
2022-09-22 01:33:32 +00:00
// https://github.com/apple/swift-format#matching-swift-format-to-your-swift-version-swift-57-and-earlier
#if compiler(>=5.7)
package.dependencies += [
.package(url: "https://github.com/apple/swift-format", .branch("release/5.7"))
]
#elseif compiler(>=5.6)
2022-07-04 21:08:46 +00:00
package.dependencies += [
.package(url: "https://github.com/apple/swift-format", .branch("release/5.6"))
]
#elseif compiler(>=5.5)
package.dependencies += [
.package(url: "https://github.com/apple/swift-format", .branch("swift-5.5-branch"))
]
#elseif compiler(>=5.4)
package.dependencies += [
.package(url: "https://github.com/apple/swift-format", .branch("swift-5.4-branch"))
]
#elseif compiler(>=5.3)
package.dependencies += [
.package(url: "https://github.com/apple/swift-format", .branch("swift-5.3-branch"))
]
#endif