Skip to content

Commit a78d53e

Browse files
loic-sharmaandroidseb
authored andcommitted
[google_sign_in_ios] Adds Swift Package Manager support (flutter#7356)
Adds Swift Package Manager support to `google_sign_in_ios`. Fixes flutter/flutter#146904
1 parent 56980c0 commit a78d53e

File tree

21 files changed

+155
-90
lines changed

21 files changed

+155
-90
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ 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.
@@ -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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
.package(
20+
url: "https://github.com/google/GoogleSignIn-iOS.git",
21+
from: "7.1.0")
22+
],
23+
targets: [
24+
.target(
25+
name: "google_sign_in_ios",
26+
dependencies: [
27+
.product(name: "GoogleSignIn", package: "GoogleSignIn-iOS")
28+
],
29+
exclude: [
30+
"include/google_sign_in_ios-umbrella.h", "include/FLTGoogleSignInPlugin.modulemap",
31+
],
32+
resources: [
33+
.process("Resources")
34+
],
35+
cSettings: [
36+
.headerSearchPath("include/google_sign_in_ios")
37+
]
38+
)
39+
]
40+
)

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)