Skip to content

Commit 35f8ae0

Browse files
committed
rdar://93920177 (Adjust SwiftPM 5.7 to minimum supported deployment target changes)
Update minimum supported deployment targets and mark older version constants as deprecated in tools-version 5.7
1 parent 27694b5 commit 35f8ae0

File tree

5 files changed

+34
-24
lines changed

5 files changed

+34
-24
lines changed

Sources/PackageDescription/SupportedPlatforms.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,19 @@ extension SupportedPlatform {
274274
/// The value that represents macOS 10.10.
275275
///
276276
/// - Since: First available in PackageDescription 5.0.
277+
@available(_PackageDescription, deprecated: 5.7, message: "macOS 10.13 is the oldest supported version")
277278
public static let v10_10: MacOSVersion = .init(string: "10.10")
278279

279280
/// The value that represents macOS 10.11.
280281
///
281282
/// - Since: First available in PackageDescription 5.0.
283+
@available(_PackageDescription, deprecated: 5.7, message: "macOS 10.13 is the oldest supported version")
282284
public static let v10_11: MacOSVersion = .init(string: "10.11")
283285

284286
/// The value that represents macOS 10.12.
285287
///
286288
/// - Since: First available in PackageDescription 5.0.
289+
@available(_PackageDescription, deprecated: 5.7, message: "macOS 10.13 is the oldest supported version")
287290
public static let v10_12: MacOSVersion = .init(string: "10.12")
288291

289292
/// The value that represents macOS 10.13.
@@ -339,11 +342,13 @@ extension SupportedPlatform {
339342
/// The value that represents tvOS 9.0.
340343
///
341344
/// - Since: First available in PackageDescription 5.0.
345+
@available(_PackageDescription, deprecated: 5.7, message: "tvOS 11.0 is the oldest supported version")
342346
public static let v9: TVOSVersion = .init(string: "9.0")
343347

344348
/// The value that represents tvOS 10.0.
345349
///
346350
/// - Since: First available in PackageDescription 5.0.
351+
@available(_PackageDescription, deprecated: 5.7, message: "tvOS 11.0 is the oldest supported version")
347352
public static let v10: TVOSVersion = .init(string: "10.0")
348353

349354
/// The value that represents tvOS 11.0.
@@ -433,16 +438,19 @@ extension SupportedPlatform {
433438
/// The value that represents iOS 8.0.
434439
///
435440
/// - Since: First available in PackageDescription 5.0.
441+
@available(_PackageDescription, deprecated: 5.7, message: "iOS 11.0 is the oldest supported version")
436442
public static let v8: IOSVersion = .init(string: "8.0")
437443

438444
/// The value that represents iOS 9.0.
439445
///
440446
/// - Since: First available in PackageDescription 5.0.
447+
@available(_PackageDescription, deprecated: 5.7, message: "iOS 11.0 is the oldest supported version")
441448
public static let v9: IOSVersion = .init(string: "9.0")
442449

443450
/// The value that represents iOS 10.0.
444451
///
445452
/// - Since: First available in PackageDescription 5.0.
453+
@available(_PackageDescription, deprecated: 5.7, message: "iOS 11.0 is the oldest supported version")
446454
public static let v10: IOSVersion = .init(string: "10.0")
447455

448456
/// The value that represents iOS 11.0.
@@ -495,11 +503,13 @@ extension SupportedPlatform {
495503
/// The value that represents watchOS 2.0.
496504
///
497505
/// - Since: First available in PackageDescription 5.0.
506+
@available(_PackageDescription, deprecated: 5.7, message: "watchOS 4.0 is the oldest supported version")
498507
public static let v2: WatchOSVersion = .init(string: "2.0")
499508

500509
/// The value that represents watchOS 3.0.
501510
///
502511
/// - Since: First available in PackageDescription 5.0.
512+
@available(_PackageDescription, deprecated: 5.7, message: "watchOS 4.0 is the oldest supported version")
503513
public static let v3: WatchOSVersion = .init(string: "3.0")
504514

505515
/// The value that represents watchOS 4.0.

Sources/PackageModel/Platform.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public struct Platform: Equatable, Hashable, Codable {
3131
return Platform(name: name, oldestSupportedVersion: PlatformVersion(oldestSupportedVersion))
3232
}
3333

34-
public static let macOS: Platform = Platform(name: "macos", oldestSupportedVersion: "10.10")
34+
public static let macOS: Platform = Platform(name: "macos", oldestSupportedVersion: "10.13")
3535
public static let macCatalyst: Platform = Platform(name: "maccatalyst", oldestSupportedVersion: "13.0")
36-
public static let iOS: Platform = Platform(name: "ios", oldestSupportedVersion: "9.0")
37-
public static let tvOS: Platform = Platform(name: "tvos", oldestSupportedVersion: "9.0")
38-
public static let watchOS: Platform = Platform(name: "watchos", oldestSupportedVersion: "2.0")
36+
public static let iOS: Platform = Platform(name: "ios", oldestSupportedVersion: "11.0")
37+
public static let tvOS: Platform = Platform(name: "tvos", oldestSupportedVersion: "11.0")
38+
public static let watchOS: Platform = Platform(name: "watchos", oldestSupportedVersion: "4.0")
3939
public static let driverKit: Platform = Platform(name: "driverkit", oldestSupportedVersion: "19.0")
4040
public static let linux: Platform = Platform(name: "linux", oldestSupportedVersion: .unknown)
4141
public static let android: Platform = Platform(name: "android", oldestSupportedVersion: .unknown)

Tests/BuildTests/MockBuildTestHelper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension AbsolutePath {
4545

4646
let hostTriple = UserToolchain.default.triple
4747
#if os(macOS)
48-
let defaultTargetTriple: String = hostTriple.tripleString(forPlatformVersion: "10.10")
48+
let defaultTargetTriple: String = hostTriple.tripleString(forPlatformVersion: "10.13")
4949
#else
5050
let defaultTargetTriple: String = hostTriple.tripleString
5151
#endif

Tests/PackageGraphTests/PackageGraphTests.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,12 +1911,12 @@ class PackageGraphTests: XCTestCase {
19111911

19121912
let defaultDerivedPlatforms = [
19131913
"linux": "0.0",
1914-
"macos": "10.10",
1914+
"macos": "10.13",
19151915
"maccatalyst": "13.0",
1916-
"ios": "9.0",
1917-
"tvos": "9.0",
1916+
"ios": "11.0",
1917+
"tvos": "11.0",
19181918
"driverkit": "19.0",
1919-
"watchos": "2.0",
1919+
"watchos": "4.0",
19201920
"android": "0.0",
19211921
"windows": "0.0",
19221922
"wasi": "0.0",
@@ -1946,9 +1946,9 @@ class PackageGraphTests: XCTestCase {
19461946

19471947
let customXCTestMinimumDeploymentTargets = [
19481948
PackageModel.Platform.macOS: PlatformVersion("10.15"),
1949-
PackageModel.Platform.iOS: PlatformVersion("9.0"),
1950-
PackageModel.Platform.tvOS: PlatformVersion("9.0"),
1951-
PackageModel.Platform.watchOS: PlatformVersion("2.0"),
1949+
PackageModel.Platform.iOS: PlatformVersion("11.0"),
1950+
PackageModel.Platform.tvOS: PlatformVersion("11.0"),
1951+
PackageModel.Platform.watchOS: PlatformVersion("4.0"),
19521952
]
19531953

19541954
let observability = ObservabilitySystem.makeForTesting()
@@ -2099,12 +2099,12 @@ class PackageGraphTests: XCTestCase {
20992099

21002100
let defaultDerivedPlatforms = [
21012101
"linux": "0.0",
2102-
"macos": "10.10",
2102+
"macos": "10.13",
21032103
"maccatalyst": "13.0",
2104-
"ios": "9.0",
2105-
"tvos": "9.0",
2104+
"ios": "11.0",
2105+
"tvos": "11.0",
21062106
"driverkit": "19.0",
2107-
"watchos": "2.0",
2107+
"watchos": "4.0",
21082108
"android": "0.0",
21092109
"windows": "0.0",
21102110
"wasi": "0.0",

Tests/XCBuildSupportTests/PIFBuilderTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ class PIFBuilderTests: XCTestCase {
186186
XCTAssertEqual(settings[.ENTITLEMENTS_REQUIRED], "NO")
187187
XCTAssertEqual(settings[.GCC_OPTIMIZATION_LEVEL], "0")
188188
XCTAssertEqual(settings[.GCC_PREPROCESSOR_DEFINITIONS], ["$(inherited)", "SWIFT_PACKAGE", "DEBUG=1"])
189-
XCTAssertEqual(settings[.IPHONEOS_DEPLOYMENT_TARGET], "9.0")
189+
XCTAssertEqual(settings[.IPHONEOS_DEPLOYMENT_TARGET], "11.0")
190190
XCTAssertEqual(settings[.IPHONEOS_DEPLOYMENT_TARGET, for: .macCatalyst], "13.0")
191191
XCTAssertEqual(settings[.KEEP_PRIVATE_EXTERNS], "NO")
192-
XCTAssertEqual(settings[.MACOSX_DEPLOYMENT_TARGET], "10.10")
192+
XCTAssertEqual(settings[.MACOSX_DEPLOYMENT_TARGET], "10.13")
193193
XCTAssertEqual(settings[.ONLY_ACTIVE_ARCH], "YES")
194194
XCTAssertEqual(settings[.OTHER_LDRFLAGS], [])
195195
XCTAssertEqual(settings[.PRODUCT_NAME], "$(TARGET_NAME)")
@@ -201,9 +201,9 @@ class PIFBuilderTests: XCTestCase {
201201
XCTAssertEqual(settings[.SWIFT_INSTALL_OBJC_HEADER], "NO")
202202
XCTAssertEqual(settings[.SWIFT_OBJC_INTERFACE_HEADER_NAME], "")
203203
XCTAssertEqual(settings[.SWIFT_OPTIMIZATION_LEVEL], "-Onone")
204-
XCTAssertEqual(settings[.TVOS_DEPLOYMENT_TARGET], "9.0")
204+
XCTAssertEqual(settings[.TVOS_DEPLOYMENT_TARGET], "11.0")
205205
XCTAssertEqual(settings[.USE_HEADERMAP], "NO")
206-
XCTAssertEqual(settings[.WATCHOS_DEPLOYMENT_TARGET], "2.0")
206+
XCTAssertEqual(settings[.WATCHOS_DEPLOYMENT_TARGET], "4.0")
207207

208208
let frameworksSearchPaths = ["$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks"]
209209
for platform in [PIF.BuildSettings.Platform.macOS, .iOS, .tvOS] {
@@ -232,10 +232,10 @@ class PIFBuilderTests: XCTestCase {
232232
XCTAssertEqual(settings[.ENTITLEMENTS_REQUIRED], "NO")
233233
XCTAssertEqual(settings[.GCC_OPTIMIZATION_LEVEL], "s")
234234
XCTAssertEqual(settings[.GCC_PREPROCESSOR_DEFINITIONS], ["$(inherited)", "SWIFT_PACKAGE"])
235-
XCTAssertEqual(settings[.IPHONEOS_DEPLOYMENT_TARGET], "9.0")
235+
XCTAssertEqual(settings[.IPHONEOS_DEPLOYMENT_TARGET], "11.0")
236236
XCTAssertEqual(settings[.IPHONEOS_DEPLOYMENT_TARGET, for: .macCatalyst], "13.0")
237237
XCTAssertEqual(settings[.KEEP_PRIVATE_EXTERNS], "NO")
238-
XCTAssertEqual(settings[.MACOSX_DEPLOYMENT_TARGET], "10.10")
238+
XCTAssertEqual(settings[.MACOSX_DEPLOYMENT_TARGET], "10.13")
239239
XCTAssertEqual(settings[.OTHER_LDRFLAGS], [])
240240
XCTAssertEqual(settings[.PRODUCT_NAME], "$(TARGET_NAME)")
241241
XCTAssertEqual(settings[.SDK_VARIANT], "auto")
@@ -246,9 +246,9 @@ class PIFBuilderTests: XCTestCase {
246246
XCTAssertEqual(settings[.SWIFT_INSTALL_OBJC_HEADER], "NO")
247247
XCTAssertEqual(settings[.SWIFT_OBJC_INTERFACE_HEADER_NAME], "")
248248
XCTAssertEqual(settings[.SWIFT_OPTIMIZATION_LEVEL], "-Owholemodule")
249-
XCTAssertEqual(settings[.TVOS_DEPLOYMENT_TARGET], "9.0")
249+
XCTAssertEqual(settings[.TVOS_DEPLOYMENT_TARGET], "11.0")
250250
XCTAssertEqual(settings[.USE_HEADERMAP], "NO")
251-
XCTAssertEqual(settings[.WATCHOS_DEPLOYMENT_TARGET], "2.0")
251+
XCTAssertEqual(settings[.WATCHOS_DEPLOYMENT_TARGET], "4.0")
252252

253253
let frameworksSearchPaths = ["$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks"]
254254
for platform in [PIF.BuildSettings.Platform.macOS, .iOS, .tvOS] {

0 commit comments

Comments
 (0)