-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathPackage.swift
More file actions
42 lines (38 loc) · 1.32 KB
/
Package.swift
File metadata and controls
42 lines (38 loc) · 1.32 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
// swift-tools-version: 5.7
import PackageDescription
import class Foundation.ProcessInfo
var package = Package(
name: "CooklangParser",
platforms: [
.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.18.3/CooklangParserFFI.xcframework.zip",
checksum: "0cac8974fd3d02542addbf9b0f909b6b3eed4833016d954928bd473b90ac17c8"),
]
)
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")
}