-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPackage.swift
109 lines (102 loc) · 3.67 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
// swift-tools-version:6.0
//
// This source file is part of the ResearchKitOnFHIR open source project
//
// SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//
import class Foundation.ProcessInfo
import PackageDescription
let package = Package(
name: "ResearchKitOnFHIR",
platforms: [
.iOS(.v17),
.watchOS(.v10),
.visionOS(.v1),
.macOS(.v14)
],
products: [
.library(name: "ResearchKitOnFHIR", targets: ["ResearchKitOnFHIR"]),
.library(name: "FHIRQuestionnaires", targets: ["FHIRQuestionnaires"])
],
dependencies: [
.package(url: "https://github.com/StanfordBDHG/ResearchKit.git", .upToNextMinor(from: "3.0.1")),
.package(url: "https://github.com/apple/FHIRModels.git", .upToNextMinor(from: "0.5.0")),
.package(url: "https://github.com/antlr/antlr4.git", from: "4.13.1")
] + swiftLintPackage(),
targets: [
.target(
name: "ResearchKitOnFHIR",
dependencies: [
.product(name: "ResearchKit", package: "ResearchKit"),
.product(name: "ResearchKitSwiftUI", package: "ResearchKit"),
.product(name: "ModelsR4", package: "FHIRModels"),
.target(name: "FHIRPathParser")
],
plugins: [] + swiftLintPlugin()
),
.target(
name: "FHIRQuestionnaires",
dependencies: [
.product(name: "ModelsR4", package: "FHIRModels")
],
resources: [
.copy("Resources/SkipLogicExample.json"),
.copy("Resources/TextValidationExample.json"),
.copy("Resources/ContainedValueSetExample.json"),
.copy("Resources/NumberExample.json"),
.copy("Resources/DateTimeExample.json"),
.copy("Resources/PHQ-9.json"),
.copy("Resources/GAD-7.json"),
.copy("Resources/GCS.json"),
.copy("Resources/IPSS.json"),
.copy("Resources/FormExample.json"),
.copy("Resources/MultipleEnableWhen.json"),
.copy("Resources/ImageCapture.json"),
.copy("Resources/SliderExample.json")
],
plugins: [] + swiftLintPlugin()
),
.target(
name: "FHIRPathParser",
dependencies: [
.product(name: "Antlr4", package: "antlr4")
],
exclude: [
"ANTLUtils"
],
plugins: [] + swiftLintPlugin()
),
.testTarget(
name: "ResearchKitOnFHIRTests",
dependencies: [
.target(name: "ResearchKitOnFHIR"),
.target(name: "FHIRQuestionnaires")
],
plugins: [] + swiftLintPlugin()
),
.testTarget(
name: "FHIRPathParserTests",
dependencies: [
.target(name: "FHIRPathParser")
],
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 {
[]
}
}