-
-
Notifications
You must be signed in to change notification settings - Fork 366
/
Package.swift
36 lines (28 loc) · 1.18 KB
/
Package.swift
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:5.0
// 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: "2.0.0")),
.package(url: "https://github.com/Quick/Nimble.git", .upToNextMajor(from: "8.0.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",
platforms: [
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2)
],
products: [
.library(name: "SwiftyUserDefaults", targets: ["SwiftyUserDefaults"]),
],
dependencies: resolveDependencies(),
targets: resolveTargets()
)