-
-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathPackage.swift
More file actions
72 lines (67 loc) · 2.51 KB
/
Copy pathPackage.swift
File metadata and controls
72 lines (67 loc) · 2.51 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
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
66
67
68
69
70
71
72
// swift-tools-version:6.0
import PackageDescription
#if canImport(Darwin)
let privacyManifestExclude: [String] = []
let privacyManifestResource: [PackageDescription.Resource] = [.copy("Resources/PrivacyInfo.xcprivacy")]
#else
// Exclude on other platforms to avoid build warnings.
let privacyManifestExclude: [String] = ["Resources/PrivacyInfo.xcprivacy"]
let privacyManifestResource: [PackageDescription.Resource] = []
#endif
#if canImport(Darwin)
let httpClientDependency: [Package.Dependency] = []
let httpClientTargetDependency: [Target.Dependency] = []
#else
let httpClientDependency: [Package.Dependency] = [
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.24.0")
]
let httpClientTargetDependency: [Target.Dependency] = [
.product(name: "AsyncHTTPClient", package: "async-http-client")
]
#endif
let package = Package(
name: "TPInAppReceipt",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS("6.2"),
.visionOS(.v1),
.macCatalyst(.v13),
],
products: [
.library(name: "TPInAppReceipt", targets: ["TPInAppReceipt"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-asn1", .upToNextMajor(from: "1.5.0")),
.package(url: "https://github.com/apple/swift-certificates.git", .upToNextMajor(from: "1.15.1")),
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMajor(from: "4.2.0")),
] + httpClientDependency,
targets: [
.target(
name: "TPInAppReceipt",
dependencies: [
.product(name: "SwiftASN1", package: "swift-asn1"),
.product(name: "X509", package: "swift-certificates"),
.product(name: "Crypto", package: "swift-crypto"),
] + httpClientTargetDependency,
path: "Sources",
exclude: privacyManifestExclude,
resources: privacyManifestResource + [
.process("Resources/AppleIncRootCertificate.cer"),
.process("Resources/StoreKitTestCertificate.cer"),
]
),
.testTarget(
name: "TPInAppReceiptTests",
dependencies: [
"TPInAppReceipt",
.product(name: "SwiftASN1", package: "swift-asn1"),
.product(name: "X509", package: "swift-certificates"),
.product(name: "Crypto", package: "swift-crypto"),
],
path: "Tests",
resources: [.copy("Assets")]
),
]
)