Skip to content

Commit 45f7cd9

Browse files
committed
Ensure new packages have the correct minimum OS targets when using swift-testing.
swift-testing has a minimum deployment target set higher than the default for packages. We need to ensure that it is respected by `swift package init --enable-experimental-swift-testing`.
1 parent 6bcbf11 commit 45f7cd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Workspace/InitPackage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ public final class InitPackage {
186186

187187
var platforms = options.platforms
188188

189-
// Macros require macOS 10.15, iOS 13, etc.
190-
if packageType == .macro {
189+
// Macros and swift-testing require macOS 10.15, iOS 13, etc.
190+
if packageType == .macro || options.supportedTestingLibraries.contains(.swiftTesting) {
191191
func addIfMissing(_ newPlatform: SupportedPlatform) {
192192
if platforms.contains(where: { platform in
193193
platform.platform == newPlatform.platform

0 commit comments

Comments
 (0)