Skip to content

Commit 6742ed1

Browse files
committed
Only apply standard swift settings on valid targets
1 parent 93b188b commit 6742ed1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: Package.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import PackageDescription
1919
let swiftSettings: [SwiftSetting] = [
2020
// https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md
2121
// Require `any` for existential types.
22-
.enableUpcomingFeature("ExistentialAny"),
23-
.enableExperimentalFeature("StrictConcurrency=complete"),
22+
.enableUpcomingFeature("ExistentialAny"), .enableExperimentalFeature("StrictConcurrency=complete"),
2423
]
2524

2625
let package = Package(
@@ -54,11 +53,13 @@ let package = Package(
5453

5554
// --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //
5655
for target in package.targets {
57-
if target.type != .plugin {
56+
switch target.type {
57+
case .regular, .test, .executable:
5858
var settings = target.swiftSettings ?? []
5959
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
6060
settings.append(.enableUpcomingFeature("MemberImportVisibility"))
6161
target.swiftSettings = settings
62+
case .macro, .plugin, .system, .binary: () // not applicable
63+
@unknown default: () // we don't know what to do here, do nothing
6264
}
63-
}
64-
// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //
65+
}// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //

0 commit comments

Comments
 (0)