Skip to content

Commit 2feb630

Browse files
authored
Add constants for new OS versions (#3537)
rdar://79035351
1 parent 374f1ea commit 2feb630

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

Sources/PackageDescription/SupportedPlatforms.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ extension SupportedPlatform {
269269
/// - Since: First available in PackageDescription 5.3
270270
@available(_PackageDescription, introduced: 5.3)
271271
public static let v11: MacOSVersion = .init(string: "11.0")
272+
273+
/// The value that represents macOS 12.0.
274+
///
275+
/// - Since: First available in PackageDescription 5.5
276+
@available(_PackageDescription, introduced: 5.5)
277+
public static let v12: MacOSVersion = .init(string: "12.0")
272278
}
273279

274280
/// The supported tvOS version.
@@ -314,6 +320,12 @@ extension SupportedPlatform {
314320
/// - Since: First available in PackageDescription 5.3
315321
@available(_PackageDescription, introduced: 5.3)
316322
public static let v14: TVOSVersion = .init(string: "14.0")
323+
324+
/// The value that represents tvOS 15.0.
325+
///
326+
/// - Since: First available in PackageDescription 5.5
327+
@available(_PackageDescription, introduced: 5.5)
328+
public static let v15: TVOSVersion = .init(string: "15.0")
317329
}
318330

319331
/// The supported Mac Catalyst version.
@@ -339,6 +351,12 @@ extension SupportedPlatform {
339351
/// - Since: First available in PackageDescription 5.5
340352
@available(_PackageDescription, introduced: 5.5)
341353
public static let v14: MacCatalystVersion = .init(string: "14.0")
354+
355+
/// The value that represents Mac Catalyst 15.0.
356+
///
357+
/// - Since: First available in PackageDescription 5.5
358+
@available(_PackageDescription, introduced: 5.5)
359+
public static let v15: MacCatalystVersion = .init(string: "15.0")
342360
}
343361

344362
/// The supported iOS version.
@@ -389,6 +407,12 @@ extension SupportedPlatform {
389407
/// - Since: First available in PackageDescription 5.3
390408
@available(_PackageDescription, introduced: 5.3)
391409
public static let v14: IOSVersion = .init(string: "14.0")
410+
411+
/// The value that represents iOS 15.0.
412+
///
413+
/// - Since: First available in PackageDescription 5.5
414+
@available(_PackageDescription, introduced: 5.5)
415+
public static let v15: IOSVersion = .init(string: "15.0")
392416
}
393417

394418
/// The supported watchOS version.
@@ -434,6 +458,12 @@ extension SupportedPlatform {
434458
/// - Since: First available in PackageDescription 5.3
435459
@available(_PackageDescription, introduced: 5.3)
436460
public static let v7: WatchOSVersion = .init(string: "7.0")
461+
462+
/// The value that represents watchOS 8.0.
463+
///
464+
/// - Since: First available in PackageDescription 5.5
465+
@available(_PackageDescription, introduced: 5.5)
466+
public static let v8: WatchOSVersion = .init(string: "8.0")
437467
}
438468

439469
/// The supported DriverKit version.
@@ -455,6 +485,10 @@ extension SupportedPlatform {
455485
/// The value that represents DriverKit 20.0.
456486
@available(_PackageDescription, introduced: 5.5)
457487
public static let v20: DriverKitVersion = .init(string: "20.0")
488+
489+
/// The value that represents DriverKit 21.0.
490+
@available(_PackageDescription, introduced: 5.5)
491+
public static let v21: DriverKitVersion = .init(string: "21.0")
458492
}
459493
}
460494

Tests/PackageLoadingTests/PD5_5LoadingTests.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,30 @@ class PackageDescription5_5LoadingTests: PackageDescriptionLoadingTests {
8787
XCTAssertEqual(manifest.targets[0].sources, ["CountMeIn.swift"])
8888
}
8989
}
90+
91+
func testPlatforms() throws {
92+
let stream = BufferedOutputByteStream()
93+
stream <<< """
94+
import PackageDescription
95+
let package = Package(
96+
name: "Foo",
97+
platforms: [
98+
.macOS(.v12), .iOS(.v15),
99+
.tvOS(.v15), .watchOS(.v8),
100+
.macCatalyst(.v15), .driverKit(.v21),
101+
]
102+
)
103+
"""
104+
105+
loadManifest(stream.bytes) { manifest in
106+
XCTAssertEqual(manifest.platforms, [
107+
PlatformDescription(name: "macos", version: "12.0"),
108+
PlatformDescription(name: "ios", version: "15.0"),
109+
PlatformDescription(name: "tvos", version: "15.0"),
110+
PlatformDescription(name: "watchos", version: "8.0"),
111+
PlatformDescription(name: "maccatalyst", version: "15.0"),
112+
PlatformDescription(name: "driverkit", version: "21.0"),
113+
])
114+
}
115+
}
90116
}

0 commit comments

Comments
 (0)