-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathPackage.swift
129 lines (111 loc) · 4.17 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// swift-tools-version:5.3
import PackageDescription
let version = "0.17.1"
let useLocalBinaries = false
let vscCommonBinaryTarget = {
if (useLocalBinaries) {
return Target.binaryTarget(name: "VSCCommon", path: "binaries//VSCCommon.xcframework.zip")
} else {
let vscCommonChecksum = "99193a9c8a71cebcaadf282ac2f4d5d398f1dee8567799d6a0cdd3e3d63ba1a3"
return Target.binaryTarget(
name: "VSCCommon",
url: "https://github.com/VirgilSecurity/virgil-crypto-c/releases/download/v\(version)/VSCCommon.xcframework.zip",
checksum: vscCommonChecksum
)
}
}()
let vscFoundationBinaryTarget = {
if (useLocalBinaries) {
return Target.binaryTarget(name: "VSCFoundation", path: "binaries//VSCFoundation.xcframework.zip")
} else {
let vscFoundationChecksum = "b38a85c73b033dc62b55e1d7c7e4988504176b451fd2e87eaad86b616921276a"
return Target.binaryTarget(
name: "VSCFoundation",
url: "https://github.com/VirgilSecurity/virgil-crypto-c/releases/download/v\(version)/VSCFoundation.xcframework.zip",
checksum: vscFoundationChecksum
)
}
}()
let vscPythiaBinaryTarget = {
if (useLocalBinaries) {
return Target.binaryTarget(name: "VSCPythia", path: "binaries//VSCPythia.xcframework.zip")
} else {
let vscPythiaChecksum = "6d5fde11d0ff1c531a7943006a4b1816e37135ea5692f60f47497b9049a649b5"
return Target.binaryTarget(
name: "VSCPythia",
url: "https://github.com/VirgilSecurity/virgil-crypto-c/releases/download/v\(version)/VSCPythia.xcframework.zip",
checksum: vscPythiaChecksum
)
}
}()
let vscRatchetBinaryTarget = {
if (useLocalBinaries) {
return Target.binaryTarget(name: "VSCRatchet", path: "binaries//VSCRatchet.xcframework.zip")
} else {
let vscRatchetChecksum = "31e8e7ed15c7596262546b53ec36622876f2025f855799e22346d3bf13c0291a"
return Target.binaryTarget(
name: "VSCRatchet",
url: "https://github.com/VirgilSecurity/virgil-crypto-c/releases/download/v\(version)/VSCRatchet.xcframework.zip",
checksum: vscRatchetChecksum
)
}
}()
let package = Package(
name: "VirgilCryptoWrapper",
platforms: [
.macOS(.v10_13), .iOS(.v11), .tvOS(.v11), .watchOS(.v4)
],
products: [
.library(
name: "VirgilCryptoFoundation",
targets: ["VirgilCryptoFoundation"]),
.library(
name: "VirgilCryptoPythia",
targets: ["VirgilCryptoPythia"]),
.library(
name: "VirgilCryptoRatchet",
targets: ["VirgilCryptoRatchet"]),
],
targets: [
//
// VSCCrypto
//
vscCommonBinaryTarget,
vscFoundationBinaryTarget,
vscPythiaBinaryTarget,
vscRatchetBinaryTarget,
//
// VirgilCryptoFoundation
//
.target(
name: "VirgilCryptoFoundation",
dependencies: ["VSCCommon", "VSCFoundation"],
path: "wrappers/swift/VirgilCrypto/VirgilCryptoFoundation"),
.testTarget(
name: "VirgilCryptoFoundationTests",
dependencies: ["VirgilCryptoFoundation"],
path: "wrappers/swift/VirgilCryptoTest/VirgilCryptoFoundationTests"),
//
// VirgilCryptoPythia
//
.target(
name: "VirgilCryptoPythia",
dependencies: ["VirgilCryptoFoundation", "VSCPythia"],
path: "wrappers/swift/VirgilCrypto/VirgilCryptoPythia"),
.testTarget(
name: "VirgilCryptoPythiaTests",
dependencies: ["VirgilCryptoPythia"],
path: "wrappers/swift/VirgilCryptoTest/VirgilCryptoPythiaTests"),
//
// VirgilCryptoRatchet
//
.target(
name: "VirgilCryptoRatchet",
dependencies: ["VirgilCryptoFoundation", "VSCRatchet"],
path: "wrappers/swift/VirgilCrypto/VirgilCryptoRatchet"),
.testTarget(
name: "VirgilCryptoRatchetTests",
dependencies: ["VirgilCryptoRatchet"],
path: "wrappers/swift/VirgilCryptoTest/VirgilCryptoRatchetTests"),
]
)