-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for watchOS 6.0.0+ #227
Conversation
@available(iOS 16, *) | ||
@available(macOS 13, *) | ||
@available(tvOS 16, *) | ||
@available(watchOS 9, *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional attributes added for minimum requirements to run the test suite on targets other than macOS.
Thank you for submitting this! I'll review on Monday when I'm back. |
Libraries/Connect/Public/Implementation/Clients/URLSessionHTTPClient.swift
Show resolved
Hide resolved
8a5c372
to
4c68923
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I'm going to follow this up with some CI updates to build for watchOS, iOS, etc. on PRs.
Pushed fixes to the PR to resolve CI issues (also started a Slack discussion to figure out what happened to the pinned conformance test version) |
Fixing CI here, changes ended up being a bit more involved: #228 |
Pulled in CI fixes from |
- Updates CI to run tests against macOS, iOS, tvOS, and watchOS rather than only the default environment (macOS) - Switches from using `swift test` to `xcodebuild test` since the former does not allow for specifying a target SDK/environment (see [this question](https://stackoverflow.com/questions/60245159/how-can-i-build-a-swift-package-for-ios-over-command-line) and [these notes](https://www.jessesquires.com/blog/2021/11/03/swift-package-ios-tests/)) - Updates `@available` annotations to properly accomodate these additional platforms Follow-up to #227 and related to #226.
- Adds new CI jobs to build the library against macOS, iOS, tvOS, and watchOS rather than only the default environment (macOS) - Updates `@available` annotations to properly accommodate these additional platforms - Updates CI to use Xcode 15.1 Originally the intent was to run tests on each platform, but for some reason GitHub runners are refusing to cooperate and jobs are stalling. Instead, we'll continue running `swift test` which runs tests on the host environment (macOS) and will use `xcodebuild` to build for each platform since it allows for specifying a target SDK/environment (see [this question](https://stackoverflow.com/questions/60245159/how-can-i-build-a-swift-package-for-ios-over-command-line) and [these notes](https://www.jessesquires.com/blog/2021/11/03/swift-package-ios-tests/)). Follow-up to #227 and related to #226.
These were changed from `CFNetworkErrors` to hardcoded values in #227 to remove the `CFNetwork` import in order to support watchOS. As an alternative, we can use `URLError` values.
These were changed from `CFNetworkErrors` to hardcoded values in #227 to remove the `CFNetwork` import in order to support watchOS. As an alternative, we can use `URLError` values and keep them strongly typed. The replacements are the same except for `CFNetworkErrors.cfurlErrorUnknown.rawValue` which will still be correctly mapped to `.unknown` via the `...100` case. <img width="629" alt="Screenshot 2024-01-20 at 10 07 47 AM" src="https://github.com/connectrpc/connect-swift/assets/2643476/0d77a632-ccae-4b6a-811f-86481fddc4b7">
Resolves #226
This PR allows connect-swift to be compiled for
watchOS
.Minimum deployment target of
watchOS 6.0.0
:AsyncStream
, which requireswatchOS 6.0.0
.AsyncStream
.As outlined in the linked issue, we cannot import
CFNetwork
onwatchOS
:CFNetwork
import removed fromURLSessionHTTPClient
.fromURLSessionCode(:)
was updated to pattern match on error codes explicitly, taking precedent fromfromHTTPStatus(:)
.Contributing checklist: