-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,13 +12,13 @@ Enables Google Sign-In in Flutter apps. | |
s.license = { :type => 'BSD', :file => '../LICENSE' } | ||
s.author = { 'Flutter Team' => '[email protected]' } | ||
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios' } | ||
s.source_files = 'Classes/**/*.{h,m}' | ||
s.public_header_files = 'Classes/**/*.h' | ||
s.module_map = 'Classes/FLTGoogleSignInPlugin.modulemap' | ||
s.source_files = 'google_sign_in_ios/Sources/google_sign_in_ios/**/*.{h,m}' | ||
s.public_header_files = 'google_sign_in_ios/Sources/google_sign_in_ios/include/**/*.h' | ||
s.module_map = 'google_sign_in_ios/Sources/google_sign_in_ios/include/FLTGoogleSignInPlugin.modulemap' | ||
|
||
# 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' | ||
s.dependency 'GTMSessionFetcher', '>= 3.4.0' | ||
s.dependency 'GoogleSignIn', '~> 7.1' | ||
s.static_framework = true | ||
|
@@ -33,5 +33,5 @@ Enables Google Sign-In in Flutter apps. | |
# GoogleSignIn depending a Swift pod (GTMAppAuth). | ||
s.swift_version = '5.0' | ||
|
||
s.resource_bundles = {'google_sign_in_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']} | ||
s.resource_bundles = {'google_sign_in_ios_privacy' => ['google_sign_in_ios/Sources/google_sign_in_ios/Resources/PrivacyInfo.xcprivacy']} | ||
end |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,48 @@ | ||||||||||||
// swift-tools-version: 5.9 | ||||||||||||
|
||||||||||||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||||||||||||
// Use of this source code is governed by a BSD-style license that can be | ||||||||||||
// found in the LICENSE file. | ||||||||||||
|
||||||||||||
import PackageDescription | ||||||||||||
|
||||||||||||
let package = Package( | ||||||||||||
name: "google_sign_in_ios", | ||||||||||||
platforms: [ | ||||||||||||
.iOS("12.0"), | ||||||||||||
.macOS("10.15"), | ||||||||||||
], | ||||||||||||
products: [ | ||||||||||||
.library(name: "google-sign-in-ios", targets: ["google_sign_in_ios"]) | ||||||||||||
], | ||||||||||||
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 commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Good question, let me fiddle with this |
||||||||||||
.package( | ||||||||||||
url: "https://github.com/openid/AppAuth-iOS.git", | ||||||||||||
from: "1.7.6"), | ||||||||||||
.package( | ||||||||||||
url: "https://github.com/google/gtm-session-fetcher.git", | ||||||||||||
from: "3.4.0"), | ||||||||||||
.package( | ||||||||||||
url: "https://github.com/google/GoogleSignIn-iOS.git", | ||||||||||||
from: "7.1.0"), | ||||||||||||
], | ||||||||||||
targets: [ | ||||||||||||
.target( | ||||||||||||
name: "google_sign_in_ios", | ||||||||||||
dependencies: [ | ||||||||||||
.product(name: "GoogleSignIn", package: "GoogleSignIn-iOS") | ||||||||||||
], | ||||||||||||
exclude: [ | ||||||||||||
"include/google_sign_in_ios-umbrella.h", "include/FLTGoogleSignInPlugin.modulemap", | ||||||||||||
], | ||||||||||||
resources: [ | ||||||||||||
.process("Resources") | ||||||||||||
], | ||||||||||||
cSettings: [ | ||||||||||||
.headerSearchPath("include/google_sign_in_ios") | ||||||||||||
] | ||||||||||||
) | ||||||||||||
] | ||||||||||||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. The previous lines inhibited warnings but also added
If the SwiftPM feature is enabled, this causes duplicate modules and the build fails. |
||
|
||
flutter_ios_podfile_setup | ||
|
||
target 'Runner' do | ||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | ||
target 'RunnerTests' do | ||
inherit! :search_paths | ||
|
||
pod 'OCMock','3.5' | ||
end | ||
end | ||
|
||
|
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