forked from sunshinejr/SwiftyUserDefaults
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (28 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import class Foundation.ProcessInfo
let shouldTest = ProcessInfo.processInfo.environment["TEST"] == "1"
func resolveDependencies() -> [Package.Dependency] {
guard shouldTest else { return [] }
return [
.package(url: "https://github.com/Quick/Quick.git", .upToNextMajor(from: "1.3.0")),
.package(url: "https://github.com/Quick/Nimble.git", .upToNextMajor(from: "7.1.0"))
]
}
func resolveTargets() -> [Target] {
let baseTarget = Target.target(name: "SwiftyUserDefaults", dependencies: [], path: "Sources")
let testTarget = Target.testTarget(name: "SwiftyUserDefaultsTests", dependencies: ["SwiftyUserDefaults", "Quick", "Nimble"])
return shouldTest ? [baseTarget, testTarget] : [baseTarget]
}
let package = Package(
name: "SwiftyUserDefaults",
products: [
.library(
name: "SwiftyUserDefaults",
targets: ["SwiftyUserDefaults"]),
],
dependencies: resolveDependencies(),
targets: resolveTargets(),
swiftLanguageVersions: [.v4_2]
)