Support Linux#43
Merged
liamnichols merged 7 commits intomainCreateAPI/CreateAPI:mainfrom Jun 30, 2022
Merged
Conversation
liamnichols
commented
Jun 28, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
While most use-cases evolve around Apple Platforms, there are still benefits to being able to use CreateAPI to generate Swift source code on Linux machines.
For example, a workflow could produce and publish the Swift package whenever a shared OpenAPI schema document is updated, but it might be more cost effective to run that flow on Linux instead of macOS machines.
Changes
Most of CreateAPI relies entirely on Swift itself and nothing within the Apple ecosystem so this was a pretty straightforward change.
The only limitation here is that the FileWatcher dependency that is used for the
--watchcommand does not support Linux. As a result, I decided to conditionally exclude this functionality when building for Linux.While ideally I would like to support Swift 5.5 on Linux too, it for some reason is not possible to access
Unicode.Scalar.Properties.isEmojiwhich causes the build to fail. I didn't find much on the internet besides this: https://forums.swift.org/t/swift-include-icu4c/39790/12. My focus here is mostly on maintaining a minimum level of Linux support rather than forcing 100% compatibility in unreasonable ways so I think its fine to skip 5.5