Compare commits

...

3 Commits

Author SHA1 Message Date
Adam Fowler 103a09a4d3
Merge 310734d2f8 into cbd39ceaca 2025-03-09 15:01:13 +03:00
Rick Newton-Rogers cbd39ceaca
Only apply standard swift settings on valid targets (#163)
Only apply standard swift settings on valid targets. The current check
ignores plugins but that is not comprehensive enough.
2025-03-07 19:34:49 +01:00
Adam Fowler 310734d2f8 If FoundationEssentials is available use it 2025-01-08 22:46:04 +00:00
2 changed files with 13 additions and 2 deletions

View File

@ -49,11 +49,16 @@ for target in package.targets {
// --- 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 --- //

View File

@ -13,10 +13,16 @@
//===----------------------------------------------------------------------===//
@_exported import CoreMetrics
import Foundation
import Dispatch
@_exported import class CoreMetrics.Timer
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
extension Timer {
/// Convenience for measuring duration of a closure.
///