Skip to content

Commit

Permalink
Lower unsupported platform minimum versions (#126)
Browse files Browse the repository at this point in the history
Lower unsupported platform minimum versions

### Motivation

Reported in #124.

In 0.1.4 (in PR #87), we improved the build time errors emitted when an adopter tries to link the generator binary itself to a product that runs on iOS, tvOS, etc (non-macOS/Linux).

Unfortunately, that broke the ability to build multi-platform packages for iOS and friends, as the minimum platform check would fail (we claim we support iOS "99"). 

Some build systems and IDEs don't correctly separate platform checks for plugins (which run on the host platform) and the final binary (which runs on the destination platform). We should help report these issues, but at the same time, we should fix this regression in 0.1.4 to work at least as well as 0.1.3 did.

### Modifications

Lower the minimum platforms to match the runtime library. This doesn't actually make the generate build correctly on these platforms (as we still have `PlatformChecks.swift`, which contains a hard, descriptive error when building on iOS and friends), it just allows passing the (incorrect) platform check in some cases.

### Result

Fixes #124.

Now, adopters can build on the same platforms they could with 0.1.3, and we still don't build on the unsupported platforms.

### Test Plan

Tested by using a local workspace and verified that with this change, a simple package that uses the generator can build for iOS.


Reviewed by: simonjbeaumont

Builds:
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (docc test) - Build finished. 
     ✔︎ pull request validation (integration test) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

#126
  • Loading branch information
czechboy0 authored Jul 18, 2023
1 parent 89b9d7b commit 31bb517
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let package = Package(
// The platforms below are not currently supported for running
// the generator itself. We include them here to allow the generator
// to emit a more descriptive compiler error.
.iOS("99"), .tvOS("99"), .watchOS("99"),
.iOS(.v13), .tvOS(.v13), .watchOS(.v6),
],
products: [
.executable(name: "swift-openapi-generator", targets: ["swift-openapi-generator"]),
Expand Down

0 comments on commit 31bb517

Please sign in to comment.