-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
62 lines (54 loc) · 1.51 KB
/
Package.swift
File metadata and controls
62 lines (54 loc) · 1.51 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
// swift-tools-version: 6.1
import PackageDescription
let package = Package(
name: "swift-keypath-mapping",
products: [
.library(
name: "KeyPathMapping",
targets: ["KeyPathMapping"]
)
],
traits: [
.trait(
name: "PredefinedConversions",
description: "Enables predefined conversions"
),
],
dependencies: [
.package(
url: "https://github.com/capturecontext/swift-marker-protocols.git",
.upToNextMajor(from: "1.5.1")
),
],
targets: [
.target(
name: "KeyPathMapping",
dependencies: [
.product(
name: "SwiftMarkerProtocols",
package: "swift-marker-protocols"
),
]
),
.testTarget(
name: "KeyPathMappingTests",
dependencies: ["KeyPathMapping"]
)
],
swiftLanguageModes: [.v6]
)
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
// Workaround to ensure that all traits are included in documentation. Swift Package Index adds
// SPI_GENERATE_DOCS (https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/2336)
// when building documentation, so only tweak the default traits in this condition.
let spiGenerateDocs = ProcessInfo.processInfo.environment["SPI_GENERATE_DOCS"] != nil
// Enable all traits for other CI actions.
let enableAllTraitsExplicit = ProcessInfo.processInfo.environment["ENABLE_ALL_TRAITS"] != nil
let enableAllTraits = spiGenerateDocs || enableAllTraitsExplicit
package.traits.insert(.default(
enabledTraits: Set(enableAllTraits ? package.traits.map(\.name) : ["PredefinedConversions"])
))