Skip to content

Commit

Permalink
Only apply standard swift settings on valid targets (#145)
Browse files Browse the repository at this point in the history
Only apply standard swift settings on valid targets. The current check
ignores plugins but that is not comprehensive enough.
  • Loading branch information
rnro authored Mar 7, 2025
1 parent ae88002 commit 81c309c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ let package = Package(

// --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //
for target in package.targets {
if target.type != .plugin {
switch target.type {
case .regular, .test, .executable:
var settings = target.swiftSettings ?? []
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
settings.append(.enableUpcomingFeature("MemberImportVisibility"))
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 --- //

0 comments on commit 81c309c

Please sign in to comment.