forked from RevenueCat/purchases-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
67 lines (56 loc) · 2.15 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// swift-tools-version:5.1
// 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] {
if shouldTest {
return [
.package(url: "https://github.com/AliSoftware/OHHTTPStubs.git", .branch("feature/spm-support")),
.package(url: "https://github.com/Quick/Nimble", .exact("8.0.4"))
]
}
return []
}
func resolveTargets() -> [Target] {
let baseTargets: [Target] = [
.target(name: "Purchases",
dependencies: [],
path: ".",
exclude: ["Purchases/Info.plist"],
sources: ["Purchases"],
publicHeadersPath: "Purchases/Public",
cSettings: [
.headerSearchPath("Purchases"),
.headerSearchPath("Purchases/Caching"),
.headerSearchPath("Purchases/FoundationExtensions"),
.headerSearchPath("Purchases/Misc"),
.headerSearchPath("Purchases/Networking"),
.headerSearchPath("Purchases/Public"),
.headerSearchPath("Purchases/Purchasing"),
.headerSearchPath("Purchases/ProtectedExtensions"),
.headerSearchPath("Purchases/SubscriberAttributes"),
])]
if shouldTest {
let testTargets: [Target] = [
.testTarget(name: "PurchasesTests",
dependencies: ["Purchases", "OHHTTPStubs", "Nimble"],
path: "PurchasesTests",
exclude: [],
sources: nil)]
return baseTargets testTargets
}
return baseTargets
}
let package = Package(
name: "Purchases",
platforms: [
.macOS(.v10_12), .iOS(.v9), .watchOS("6.2"), .tvOS(.v9)
],
products: [
.library(name: "Purchases",
targets: ["Purchases"]),
],
dependencies: resolveDependencies(),
targets: resolveTargets()
)