forked from ResearchKit/ResearchKit
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Package.swift
72 lines (63 loc) · 2.16 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
// swift-tools-version:5.10
import class Foundation.ProcessInfo
import PackageDescription
#if swift(<6)
let swiftConcurrency: SwiftSetting = .enableExperimentalFeature("StrictConcurrency")
#else
let swiftConcurrency: SwiftSetting = .enableUpcomingFeature("StrictConcurrency")
#endif
let package = Package(
name: "ResearchKit",
platforms: [
.iOS(.v17),
.visionOS(.v1)
],
products: [
.library(name: "ResearchKit", targets: ["ResearchKit"]),
.library(name: "ResearchKitUI", targets: ["ResearchKitUI"]),
.library(name: "ResearchKitActiveTask", targets: ["ResearchKitActiveTask"]),
.library(name: "ResearchKitSwiftUI", targets: ["ResearchKitSwiftUI"])
],
dependencies: [] + swiftLintPackage(),
targets: [
.binaryTarget(
name: "ResearchKit",
path: "./Sources/ResearchKit.xcframework"
),
.binaryTarget(
name: "ResearchKitUI",
path: "./Sources/ResearchKitUI.xcframework"
),
.binaryTarget(
name: "ResearchKitActiveTask",
path: "./Sources/ResearchKitActiveTask.xcframework"
),
.target(
name: "ResearchKitSwiftUI",
dependencies: [
.target(name: "ResearchKit"),
.target(name: "ResearchKitUI"),
.target(name: "ResearchKitActiveTask", condition: .when(platforms: [.iOS]))
],
swiftSettings: [
swiftConcurrency
],
plugins: [] + swiftLintPlugin()
)
]
)
func swiftLintPlugin() -> [Target.PluginUsage] {
// Fully quit Xcode and open again with `open --env SPEZI_DEVELOPMENT_SWIFTLINT /Applications/Xcode.app`
if ProcessInfo.processInfo.environment["SPEZI_DEVELOPMENT_SWIFTLINT"] != nil {
[.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")]
} else {
[]
}
}
func swiftLintPackage() -> [PackageDescription.Package.Dependency] {
if ProcessInfo.processInfo.environment["SPEZI_DEVELOPMENT_SWIFTLINT"] != nil {
[.package(url: "https://github.com/realm/SwiftLint.git", from: "0.55.1")]
} else {
[]
}
}