-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathPackage.swift
More file actions
105 lines (102 loc) · 3.92 KB
/
Copy pathPackage.swift
File metadata and controls
105 lines (102 loc) · 3.92 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// swift-tools-version: 6.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
extension [Platform] {
static let darwin: [Platform] = [.macOS, .macCatalyst, .iOS, .tvOS, .watchOS, .visionOS]
static let nonWasm: [Platform] = [.linux, .windows, .android, .openbsd]
static let nonDarwin: [Platform] = nonWasm + [.wasi]
}
let package = Package(
name: "JWSETKit",
defaultLocalization: "en",
platforms: [
.iOS(.v15),
.macOS(.v12),
.tvOS(.v15),
.macCatalyst(.v15),
.visionOS(.v1),
],
products: [
.library(
name: "JWSETKit",
targets: ["JWSETKit"]
),
],
traits: [
"X509",
"P256K",
"HTTP",
.default(enabledTraits: []),
],
dependencies: [
.package(url: "https://github.com/apple/swift-collections.git", from: "1.6.0"),
.package(url: "https://github.com/apple/swift-asn1.git", from: "1.7.0"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "4.5.0"),
.package(url: "https://github.com/apple/swift-certificates", from: "1.19.0"),
.package(url: "https://github.com/swift-bitcoin/secp256k1", exact: "0.7.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.31.0"),
.package(url: "https://github.com/apple/swift-http-types.git", from: "1.6.0"),
],
targets: [
.systemLibrary(
name: "Czlib",
pkgConfig: "zlib",
providers: [
.apt(["zlib1g-dev"]),
.brew(["zlib"]),
.yum(["zlib-devel"]),
]
),
.target(
name: "CryptoASN1",
dependencies: [
.product(name: "SwiftASN1", package: "swift-asn1"),
.product(name: "Crypto", package: "swift-crypto"),
],
resources: [
.process("PrivacyInfo.xcprivacy"),
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "CryptoP256K",
dependencies: [
.product(name: "SwiftASN1", package: "swift-asn1"),
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "LibSECP256k1", package: "secp256k1"),
.target(name: "CryptoASN1"),
],
resources: [
.process("PrivacyInfo.xcprivacy"),
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "JWSETKit",
dependencies: [
.product(name: "Collections", package: "swift-collections"),
.product(name: "SwiftASN1", package: "swift-asn1"),
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "X509", package: "swift-certificates", condition: .when(platforms: .darwin + .nonWasm, traits: ["X509"])),
.target(name: "CryptoASN1"),
.target(name: "CryptoP256K", condition: .when(traits: ["P256K"])),
// Linux support
.product(name: "CryptoExtras", package: "swift-crypto", condition: .when(platforms: .nonDarwin)),
.target(name: "Czlib", condition: .when(platforms: .nonWasm)),
.product(name: "AsyncHTTPClient", package: "async-http-client", condition: .when(traits: ["HTTP"])),
.product(name: "HTTPTypes", package: "swift-http-types", condition: .when(traits: ["HTTP"])),
],
resources: [
.process("PrivacyInfo.xcprivacy"),
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.testTarget(
name: "JWSETKitTests",
dependencies: [
"JWSETKit",
"CryptoP256K",
]
),
]
)