-
Notifications
You must be signed in to change notification settings - Fork 7
/
Package.swift
43 lines (39 loc) · 1.34 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
// swift-tools-version: 5.7
import PackageDescription
import class Foundation.ProcessInfo
var package = Package(
name: "cooklang-rs",
platforms: [
.macOS(.v10_15),
.iOS(.v15),
],
products: [
.library(
name: "CooklangParser",
targets: ["CooklangParser"]),
],
dependencies: [
],
targets: [
.target(
name: "CooklangParser",
path: "swift/Sources/CooklangParser"),
.testTarget(
name: "CooklangParserTests",
dependencies: ["CooklangParser"],
path: "swift/Tests/CooklangParserTests"),
.binaryTarget(
name: "CooklangParserFFI",
url: "https://github.com/cooklang/cooklang-rs/releases/download/v0.13.3/CooklangParserFFI.xcframework.zip",
checksum: "b64965748b82f8ef55019b25416c2908f0c88e7e1b85af4c7cb53b7233b38e6d"),
]
)
let cooklangParserTarget = package.targets.first(where: { $0.name == "CooklangParser" })
if ProcessInfo.processInfo.environment["USE_LOCAL_XCFRAMEWORK"] == nil {
cooklangParserTarget?.dependencies.append("CooklangParserFFI")
} else {
package.targets.append(.binaryTarget(
name: "CooklangParserFFI_local",
path: "bindings/out/CooklangParserFFI.xcframework"))
cooklangParserTarget?.dependencies.append("CooklangParserFFI_local")
}