Skip to content

Commit 972adfd

Browse files
authored
Move to Swift 5.9 as the minimum version (#394)
### Motivation Part of addressing #75 and #119. ### Modifications Bumped Swift tools version to 5.9 and made the `ExistentialAny` build setting unconditional. ### Result Building the package requires 5.9 now. ### Test Plan Ran tests, all passed when using a Swift 5.9 toolchain.
1 parent e6134b4 commit 972adfd

File tree

9 files changed

+12
-32
lines changed

9 files changed

+12
-32
lines changed

Examples/GreetingService/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:5.9
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the SwiftOpenAPIGenerator open source project

IntegrationTest/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:5.9
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the SwiftOpenAPIGenerator open source project

Package.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:5.9
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the SwiftOpenAPIGenerator open source project
@@ -16,22 +16,18 @@ import Foundation
1616
import PackageDescription
1717

1818
// General Swift-settings for all targets.
19-
var swiftSettings: [SwiftSetting] = []
20-
21-
#if swift(>=5.9)
22-
swiftSettings.append(
19+
var swiftSettings: [SwiftSetting] = [
2320
// https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md
2421
// Require `any` for existential types.
2522
.enableUpcomingFeature("ExistentialAny")
26-
)
23+
]
2724

2825
// Strict concurrency is enabled in CI; use this environment variable to enable it locally.
2926
if ProcessInfo.processInfo.environment["SWIFT_OPENAPI_STRICT_CONCURRENCY"].flatMap(Bool.init) ?? false {
3027
swiftSettings.append(contentsOf: [
3128
.define("SWIFT_OPENAPI_STRICT_CONCURRENCY"), .enableExperimentalFeature("StrictConcurrency"),
3229
])
3330
}
34-
#endif
3531

3632
let package = Package(
3733
name: "swift-openapi-generator",

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Choose one of the transports listed below, or create your own by adopting the `C
3636
| Generator versions | Supported OpenAPI versions | Minimum Swift version |
3737
| -------- | ------- | ----- |
3838
| `0.1.0` ... `0.1.11` | 3.0 | 5.8 |
39-
| `0.1.12` ... `main` | 3.0, 3.1 | 5.8 |
39+
| `0.1.12` ... `0.3.5` | 3.0, 3.1 | 5.8 |
40+
| `1.0.0-alpha.1` ... `main` | 3.0, 3.1 | 5.9 |
4041

4142
### Supported platforms and minimum versions
4243

Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Choose one of the transports listed below, or create your own by adopting the `C
4444
| Generator versions | Supported OpenAPI versions | Minimum Swift version |
4545
| -------- | ------- | ----- |
4646
| `0.1.0` ... `0.1.11` | 3.0 | 5.8 |
47-
| `0.1.12` ... `main` | 3.0, 3.1 | 5.8 |
47+
| `0.1.12` ... `0.3.5` | 3.0, 3.1 | 5.8 |
48+
| `1.0.0-alpha.1` ... `main` | 3.0, 3.1 | 5.9 |
4849

4950
See also <doc:Supported-OpenAPI-features>.
5051

Tests/OpenAPIGeneratorReferenceTests/CompatabilityTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fileprivate extension CompatibilityTest {
259259
XCTAssertNoThrow(try FileManager.default.createDirectory(at: packageDir, withIntermediateDirectories: true))
260260
let packageSwiftPath = packageDir.appendingPathComponent("Package.swift", isDirectory: false)
261261
let packageSwiftContents = """
262-
// swift-tools-version:5.8
262+
// swift-tools-version:5.9
263263
import PackageDescription
264264
let package = Package(
265265
name: "\(packageName)",

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG swift_version=5.8
1+
ARG swift_version=5.9
22
ARG ubuntu_version=jammy
33
ARG base_image=swift:${swift_version}-${ubuntu_version}
44

docker/docker-compose.2204.58.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

docker/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# % docker-compose \
66
# -f docker/docker-compose.yaml \
7-
# -f docker/docker-compose.2204.58.yaml \
7+
# -f docker/docker-compose.2204.59.yaml \
88
# run test
99
#
1010
version: "3"

0 commit comments

Comments
 (0)