[google_sign_in_ios] Adds Swift Package Manager support
Adds Swift Package Manager support to google_sign_in_ios.
This does not migrate the example app's Xcode project to use Swift Package Manager, that's tracked by https://github.com/flutter/flutter/issues/148021.
Fixes https://github.com/flutter/flutter/issues/146904
Pre-launch Checklist
- [ ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [ ] I read the Tree Hygiene page, which explains my responsibilities.
- [ ] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use
dart format.) - [ ] I signed the CLA.
- [ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g.
[shared_preferences] - [ ] I linked to at least one issue that this PR fixes in the description above.
- [ ] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [ ] I updated
CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes. - [ ] I updated/added relevant documentation (doc comments with
///). - [ ] I added new tests to check the change I am making, or this PR is test-exempt.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
From triage: still blocked on upstream issues.
AppAuth-iOS 1.7.6 was released with the fix, this PR should be unblocked now: https://github.com/openid/AppAuth-iOS/pull/871
This is failing xcode-analyze and native-test because our transitive dependency AppAuth has warnings, and we treat warnings as errors. This isn't a problem when using CocoaPods as we've configured it to ignore these warnings. Unfortunately, SwiftPM doesn't let suppress warnings in our dependencies.
Our options are to either allow packages to opt-out of warnings as errors, or, fix the warnings in the upstream dependency: https://github.com/openid/AppAuth-iOS/pull/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.
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.
Did we find/file an issue for this that we can reference in the comments?
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.
Did we find/file an issue for this that we can reference in the comments?
Looks like you can potentially use an unsafeFlag, however, "use of unsafe flags makes the products containing this target ineligible for use by other packages". I wonder if we could use it conditionally only during testing. @loic-sharma might be worth trying out. Perhaps using an environment variable?
https://stackoverflow.com/a/64842804
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 unsafeFlags, cSettings, swiftSettings to suppress dependency warnings. These worked locally on my machine. However, I could not get these suppressions to work in our CI. I was unable to reproduce locally, even if I used the same version of Xcode as our CI... It's not clear to me what's going wrong on our CI.