Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
134 lines (130 loc) · 4.02 KB
/
Copy pathPackage.swift
File metadata and controls
134 lines (130 loc) · 4.02 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// swift-tools-version: 6.4
import Foundation
import PackageDescription
let package = Package(
name: "swift-sharing",
platforms: [
.iOS(.v15),
.macOS(.v12),
.tvOS(.v15),
.watchOS(.v9),
],
products: [
.library(
name: "Sharing",
targets: ["Sharing"]
)
],
traits: [
.trait(
name: "CasePaths",
description: "Derive Shared cases from Shared enums using CasePaths"
),
.trait(
name: "CustomDump",
description: "Pretty-print and diff Sharing's data types using CustomDump"
),
.trait(
name: "IdentifiedCollections",
description: "Derive Shared elements from Shared collections using IdentifiedCollections"
),
],
dependencies: [
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.10.0"),
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.3.0"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.5.1"),
.package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-issue-reporting", from: "2.1.0"),
.package(url: "https://github.com/pointfreeco/swift-perception", "1.4.1"..<"3.0.0"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
],
targets: [
.target(
name: "Sharing",
dependencies: [
"Sharing1",
"Sharing2",
.product(
name: "CasePaths",
package: "swift-case-paths",
condition: .when(
traits: ["CasePaths"]
)
),
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(
name: "CustomDump",
package: "swift-custom-dump",
condition: .when(
traits: ["CustomDump"]
)
),
.product(name: "Dependencies", package: "swift-dependencies"),
.product(
name: "IdentifiedCollections",
package: "swift-identified-collections",
condition: .when(
traits: ["IdentifiedCollections"]
)
),
.product(name: "IssueReporting", package: "swift-issue-reporting"),
.product(name: "PerceptionCore", package: "swift-perception"),
],
resources: [
.process("PrivacyInfo.xcprivacy")
]
),
.testTarget(
name: "SharingTests",
dependencies: [
"Sharing",
.product(
name: "CasePaths",
package: "swift-case-paths",
condition: .when(
traits: ["CasePaths"]
)
),
.product(name: "CombineSchedulers", package: "combine-schedulers"),
.product(name: "CustomDump", package: "swift-custom-dump"),
.product(name: "DependenciesTestSupport", package: "swift-dependencies"),
],
exclude: ["Sharing.xctestplan"]
),
.target(
name: "Sharing1",
path: "Sources/VersionMarkerModules/Sharing1"
),
.target(
name: "Sharing2",
path: "Sources/VersionMarkerModules/Sharing2"
),
],
swiftLanguageModes: [.v6]
)
let enableAllTraits = ProcessInfo.processInfo.environment["SPI_GENERATE_DOCS"] != nil
package.traits.insert(
.default(
enabledTraits: Set(
enableAllTraits
? package.traits.map(\.name)
: [
"CustomDump",
"IdentifiedCollections",
]
)
)
)
for target in package.targets {
target.swiftSettings = target.swiftSettings ?? []
target.swiftSettings?.append(contentsOf: [
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("ImmutableWeakCaptures"),
.enableUpcomingFeature("InferIsolatedConformances"),
.enableUpcomingFeature("InternalImportsByDefault"),
.enableUpcomingFeature("MemberImportVisibility"),
.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
])
}