Skip to content

Commit 13df787

Browse files
Add visionOS to Package.swift to emit useful compilation errors (#398)
### Motivation We have provision for emitting a useful compilation error when trying to link the _generator_ to an application on darwin platforms, e.g. iOS, tvOS, watchOS. To support this, we add those platforms to the Package.swift so that the code at least tries to compile and then we can emit the `#error`. This list does not currently include visionOS so users will not get the same useful compilation error. ### Modifications Add visionOS to the platforms in Package.swift. While there, also add this to the platforms in the Package.swift for the client used in the tutorial. ### Result When compiling for visionOS and trying to link the generator, a useful compiler error will be emitted. ### Test Plan Manual.
1 parent 23073d4 commit 13df787

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let package = Package(
3737
// The platforms below are not currently supported for running
3838
// the generator itself. We include them here to allow the generator
3939
// to emit a more descriptive compiler error.
40-
.iOS(.v13), .tvOS(.v13), .watchOS(.v6),
40+
.iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1),
4141
],
4242
products: [
4343
.executable(name: "swift-openapi-generator", targets: ["swift-openapi-generator"]),

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ The generator is used during development and is supported on macOS and Linux.
4545

4646
The generated code, runtime library, and transports are supported on more platforms, listed below.
4747

48-
| Component | macOS | Linux | iOS | tvOS | watchOS |
49-
| -: | :-: | :-: | :-: | :-: | :-: |
50-
| Generator plugin and CLI | ✅ 10.15+ |||||
51-
| Generated code, runtime, transports | ✅ 10.15+ || ✅ 13+ | ✅ 13+ | ✅ 6+ |
48+
| Component | macOS | Linux | iOS | tvOS | watchOS | visionOS |
49+
| -: | :-: | :-: | :-: | :-: | :-: | :-: |
50+
| Generator plugin and CLI | ✅ 10.15+ ||||||
51+
| Generated code, runtime, transports | ✅ 10.15+ || ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ |
5252

5353
## Documentation
5454

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ The generator is used during development and is supported on macOS and Linux.
5555

5656
The generated code, runtime library, and transports are supported on more platforms, listed below.
5757

58-
| Component | macOS | Linux | iOS | tvOS | watchOS |
59-
| -: | :-: | :-: | :-: | :-: | :-: |
60-
| Generator plugin and CLI | ✅ 10.15+ |||||
61-
| Generated code, runtime, transports | ✅ 10.15+ || ✅ 13+ | ✅ 13+ | ✅ 6+ |
58+
| Component | macOS | Linux | iOS | tvOS | watchOS | visionOS |
59+
| -: | :-: | :-: | :-: | :-: | :-: | :-: |
60+
| Generator plugin and CLI | ✅ 10.15+ ||||||
61+
| Generated code, runtime, transports | ✅ 10.15+ || ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ |
6262

6363
## Topics
6464

0 commit comments

Comments
 (0)