Only apply standard swift settings on valid targets (#225)

Only apply standard swift settings on valid targets. The current check
ignores plugins but that is not comprehensive enough.
This commit is contained in:
Rick Newton-Rogers 2025-03-07 15:07:17 +00:00 committed by GitHub
parent 2724b3bf1d
commit 888a842a61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

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