-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[google_sign_in_ios] Adds Swift Package Manager support #7356
Conversation
b359e38
to
b455e98
Compare
@@ -26,17 +26,14 @@ end | |||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) | |||
|
|||
# Suppress warnings from transitive dependencies that cause analysis to fail. | |||
pod 'AppAuth', :inhibit_warnings => true | |||
pod 'GTMAppAuth', :inhibit_warnings => true | |||
inhibit_all_warnings! |
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.
The previous lines inhibited warnings but also added AppAuth
and GTMAppAuth
as CocoaPod dependencies:
pod 'AppAuth', :inhibit_warnings => true
pod 'GTMAppAuth', :inhibit_warnings => true
If the SwiftPM feature is enabled, this causes duplicate modules and the build fails.
name: "google_sign_in_ios", | ||
platforms: [ | ||
.iOS("12.0"), | ||
.macOS("10.15") |
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.
This is bumped up to macOS 10.15. Required to depend on GoogleSignIn (here)
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.
We already require 10.15 (which is good, because otherwise this would be very hard to roll out in a non-disruptive way).
], | ||
dependencies: [ | ||
// AppAuth and GTMSessionFetcher are GoogleSignIn transitive dependencies. | ||
// Depend on versions which define modules. |
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.
This mirrors:
packages/packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios.podspec
Lines 20 to 24 in 275e985
# AppAuth and GTMSessionFetcher are GoogleSignIn transitive dependencies. | |
# Depend on versions which defines modules. | |
s.dependency 'AppAuth', '>= 1.7.6' | |
s.dependency 'GTMSessionFetcher', '>= 3.4.0' | |
s.dependency 'GoogleSignIn', '~> 7.1' |
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.
Do we really need this? Isn't not defining modules something that would only apply to CocoaPods, not SPM?
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.
Good question, let me fiddle with this
f36566e
to
eb4c0d5
Compare
From triage: still blocked on upstream issues. |
AppAuth-iOS 1.7.6 was released with the fix, this PR should be unblocked now: openid/AppAuth-iOS#871 |
a11e7df
to
687528d
Compare
This is failing Our options are to either allow packages to opt-out of warnings as errors, or, fix the warnings in the upstream dependency: openid/AppAuth-iOS#888 |
I'm okay with temporarily turning off warnings-as-errors for this package, but we should have a tracking issue with context for turning it back on. Ideally we should also reference an SPM feature request for the ability to do what we used to do with Cocoapods. Having the ability to use different warning settings for code you control and code you don't is a fairly common feature in build systems. |
a25afdb
to
8964482
Compare
7eb402a
to
77e6de9
Compare
Today, we treat Xcode warnings as errors on all iOS and macOS plugins. However, the google_sign_in_ios plugin has dependencies with warnings. We're unable to suppress these warnings when using Swift Package Manager. As a workaround, we'll need to disable Xcode warnings for the google_sign_in_ios plugin. This will be done in a subsequent pull request (see #7356). This change introduces `--xcode-warnings-exceptions` to the `native-test` command. When running Xcode test, `GCC_TREAT_WARNINGS_AS_ERRORS` will be provided only if the plugin isn't on the exception list. Additionally, plugins that are the exception list are excluded from the `xcode-analyze` command. Part of flutter/flutter#146904
77e6de9
to
3cbc736
Compare
|
||
# AppAuth and GTMSessionFetcher are GoogleSignIn transitive dependencies. | ||
# Depend on versions which defines modules. | ||
s.dependency 'AppAuth', '>= 1.7.4' | ||
s.dependency 'AppAuth', '>= 1.7.6' |
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.
This fixes some but not all AppAuth-iOS warnings
Did we find/file an issue for this that we can reference in the comments? |
Looks like you can potentially use an |
It's not clear to me that that SO answer address our (and the questioner's) use case; it's showing suppressing warnings on a target being defined as part of the package, not on a dependency. Either way though, "I want warnings in my code, but not in code I don't control" is a pretty standard thing to want, and a use case we have a demonstrated need for, so we should request SPM fully (not only via unsafe flags) support it. |
To clarify, I don't consider this as blocking landing; if we do have a reference we can add, great, if not we can land without it but I think it's important that we (in parallel) provide feedback on ways that SPM doesn't work for us. |
I did try various configurations of |
3d9dff3
to
9455e71
Compare
9455e71
to
626a80a
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.
LGTM
Adds Swift Package Manager support to
google_sign_in_ios
.Fixes flutter/flutter#146904
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.