-
Notifications
You must be signed in to change notification settings - Fork 10
/
Package.swift
88 lines (82 loc) · 2.88 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
// swift-tools-version: 5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import class Foundation.ProcessInfo
let liveview_native_core_framework: Target
// To release, toggle this to `false`
let useLocalFramework = true
if useLocalFramework {
liveview_native_core_framework = .binaryTarget(
name: "liveview_native_core",
path: "./target/uniffi/swift/liveview_native_core.xcframework"
)
} else {
let releaseTag = "0.4.0-alpha-13"
let releaseChecksum = "f3972f4d40732c884c98426b28550376abaff20a3490b73367ad170f1f0bcca9"
liveview_native_core_framework = .binaryTarget(
name: "liveview_native_core",
url:
"https://github.com/liveview-native/liveview-native-core/releases/download/\(releaseTag)/liveview_native_core.xcframework.zip",
checksum: releaseChecksum
)
}
let package = Package(
name: "LiveViewNativeCore",
platforms: [
.iOS("16.0"),
.macOS("13.0"),
.watchOS("9.0"),
.tvOS("16.0"),
],
products: [
.library(
name: "LiveViewNativeCore",
targets: [
"liveview_native_core",
"LiveViewNativeCore",
]
)
],
dependencies: [
// This is used to generate documentation vio `swift package generate-documentation`
// This doesn't work because of:
// https://github.com/apple/swift-docc-plugin/issues/50 will hopefully resolve it
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
],
targets: [
liveview_native_core_framework,
.target(
name: "LiveViewNativeCore",
dependencies: [
.target(name: "liveview_native_core")
],
path: "./crates/core/liveview-native-core-swift/Sources/LiveViewNativeCore/"
),
.testTarget(
name: "LiveViewNativeCoreTests",
dependencies: [
"LiveViewNativeCore"
],
path: "./crates/core/liveview-native-core-swift/Tests/LiveViewNativeCoreTests/"
),
]
)
let environment = ProcessInfo.processInfo.environment
let runBenchmarks = environment["RUN_BENCHMARKS"] != nil
if runBenchmarks {
package.dependencies.append(
.package(
url: "https://github.com/ordo-one/package-benchmark", .upToNextMajor(from: "1.0.0")))
package.targets.append(
.executableTarget(
name: "LiveViewNativeCoreBenchmarks",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
"LiveViewNativeCore",
],
path: "./crates/core/liveview-native-core-swift/Benchmarks/LiveViewNativeCore",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
])
)
}