Skip to content

Commit 3cbc736

Browse files
committed
[google_sign_in_ios] Adds Swift Package Manager support
1 parent 45c1997 commit 3cbc736

File tree

21 files changed

+164
-91
lines changed

21 files changed

+164
-91
lines changed

packages/google_sign_in/google_sign_in_ios/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 5.8.0
22

33
* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
4+
* Adds Swift Package Manager compatibility.
45

56
## 5.7.8
67

packages/google_sign_in/google_sign_in_ios/darwin/Assets/.gitkeep

Whitespace-only changes.

packages/google_sign_in/google_sign_in_ios/darwin/Tests/GoogleSignInTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
@import XCTest;
1313
@import google_sign_in_ios;
14+
#if __has_include(<google_sign_in_ios/google_sign_in_ios-umbrella.h>)
1415
@import google_sign_in_ios.Test;
16+
#endif
1517
@import GoogleSignIn;
1618

1719
// OCMock library doesn't generate a valid modulemap.

packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Enables Google Sign-In in Flutter apps.
1212
s.license = { :type => 'BSD', :file => '../LICENSE' }
1313
s.author = { 'Flutter Team' => '[email protected]' }
1414
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios' }
15-
s.source_files = 'Classes/**/*.{h,m}'
16-
s.public_header_files = 'Classes/**/*.h'
17-
s.module_map = 'Classes/FLTGoogleSignInPlugin.modulemap'
15+
s.source_files = 'google_sign_in_ios/Sources/google_sign_in_ios/**/*.{h,m}'
16+
s.public_header_files = 'google_sign_in_ios/Sources/google_sign_in_ios/include/**/*.h'
17+
s.module_map = 'google_sign_in_ios/Sources/google_sign_in_ios/include/FLTGoogleSignInPlugin.modulemap'
1818

1919
# AppAuth and GTMSessionFetcher are GoogleSignIn transitive dependencies.
2020
# Depend on versions which defines modules.
21-
s.dependency 'AppAuth', '>= 1.7.4'
21+
s.dependency 'AppAuth', '>= 1.7.6'
2222
s.dependency 'GTMSessionFetcher', '>= 3.4.0'
2323
s.dependency 'GoogleSignIn', '~> 7.1'
2424
s.static_framework = true
@@ -33,5 +33,5 @@ Enables Google Sign-In in Flutter apps.
3333
# GoogleSignIn depending a Swift pod (GTMAppAuth).
3434
s.swift_version = '5.0'
3535

36-
s.resource_bundles = {'google_sign_in_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
36+
s.resource_bundles = {'google_sign_in_ios_privacy' => ['google_sign_in_ios/Sources/google_sign_in_ios/Resources/PrivacyInfo.xcprivacy']}
3737
end
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// swift-tools-version: 5.9
2+
3+
// Copyright 2013 The Flutter Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style license that can be
5+
// found in the LICENSE file.
6+
7+
import PackageDescription
8+
9+
let package = Package(
10+
name: "google_sign_in_ios",
11+
platforms: [
12+
.iOS("12.0"),
13+
.macOS("10.15"),
14+
],
15+
products: [
16+
.library(name: "google-sign-in-ios", targets: ["google_sign_in_ios"])
17+
],
18+
dependencies: [
19+
// AppAuth and GTMSessionFetcher are GoogleSignIn transitive dependencies.
20+
// Depend on versions which define modules.
21+
.package(
22+
url: "https://github.com/openid/AppAuth-iOS.git",
23+
from: "1.7.6"),
24+
.package(
25+
url: "https://github.com/google/gtm-session-fetcher.git",
26+
from: "3.4.0"),
27+
.package(
28+
url: "https://github.com/google/GoogleSignIn-iOS.git",
29+
from: "7.1.0"),
30+
],
31+
targets: [
32+
.target(
33+
name: "google_sign_in_ios",
34+
dependencies: [
35+
.product(name: "GoogleSignIn", package: "GoogleSignIn-iOS")
36+
],
37+
exclude: [
38+
"include/google_sign_in_ios-umbrella.h", "include/FLTGoogleSignInPlugin.modulemap",
39+
],
40+
resources: [
41+
.process("Resources")
42+
],
43+
cSettings: [
44+
.headerSearchPath("include/google_sign_in_ios")
45+
]
46+
)
47+
]
48+
)

packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m renamed to packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios/Sources/google_sign_in_ios/FLTGoogleSignInPlugin.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#import "FLTGoogleSignInPlugin.h"
6-
#import "FLTGoogleSignInPlugin_Test.h"
5+
#import "./include/google_sign_in_ios/FLTGoogleSignInPlugin.h"
6+
#import "./include/google_sign_in_ios/FLTGoogleSignInPlugin_Test.h"
77

88
#import <GoogleSignIn/GoogleSignIn.h>
99

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)