Skip to content

Commit b359e38

Browse files
committed
[google_sign_in_ios] Adds Swift Package Manager support
1 parent f7b1256 commit b359e38

File tree

18 files changed

+116
-15
lines changed

18 files changed

+116
-15
lines changed

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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Enables Google Sign-In in Flutter apps.
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' }
1515
s.source_files = 'Classes/**/*.{h,m}'
16-
s.public_header_files = 'Classes/**/*.h'
17-
s.module_map = 'Classes/FLTGoogleSignInPlugin.modulemap'
16+
s.source_files = 'google_sign_in_ios/Sources/google_sign_in_ios/**/*.{h,m}'
17+
s.public_header_files = 'google_sign_in_ios/Sources/google_sign_in_ios/include/**/*.h'
18+
s.module_map = 'google_sign_in_ios/Sources/google_sign_in_ios/include/FLTGoogleSignInPlugin.modulemap'
1819

1920
# AppAuth and GTMSessionFetcher are GoogleSignIn transitive dependencies.
2021
# Depend on versions which defines modules.
@@ -33,5 +34,5 @@ Enables Google Sign-In in Flutter apps.
3334
# GoogleSignIn depending a Swift pod (GTMAppAuth).
3435
s.swift_version = '5.0'
3536

36-
s.resource_bundles = {'google_sign_in_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
37+
s.resource_bundles = {'google_sign_in_ios_privacy' => ['google_sign_in_ios/Sources/google_sign_in_ios/Resources/PrivacyInfo.xcprivacy']}
3738
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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.4"),
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: ["include/google_sign_in_ios-umbrella.h", "include/FLTGoogleSignInPlugin.modulemap"],
38+
resources: [
39+
.process("Resources")
40+
],
41+
cSettings: [
42+
.headerSearchPath("include/google_sign_in_ios")
43+
]
44+
)
45+
]
46+
)

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

packages/google_sign_in/google_sign_in_ios/darwin/Classes/messages.g.m renamed to packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios/Sources/google_sign_in_ios/messages.g.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Autogenerated from Pigeon (v11.0.1), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

7-
#import "messages.g.h"
7+
#import "./include/google_sign_in_ios/messages.g.h"
88

99
#if TARGET_OS_OSX
1010
#import <FlutterMacOS/FlutterMacOS.h>

packages/google_sign_in/google_sign_in_ios/example/ios/Podfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,14 @@ end
2626
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
2727

2828
# Suppress warnings from transitive dependencies that cause analysis to fail.
29-
pod 'AppAuth', :inhibit_warnings => true
30-
pod 'GTMAppAuth', :inhibit_warnings => true
29+
inhibit_all_warnings!
3130

3231
flutter_ios_podfile_setup
3332

3433
target 'Runner' do
3534
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3635
target 'RunnerTests' do
3736
inherit! :search_paths
38-
39-
pod 'OCMock','3.5'
4037
end
4138
end
4239

packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
403C71302C66A2E50034A230 /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 403C712F2C66A2E50034A230 /* OCMock */; };
1011
5C6F5A6E1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */; };
1112
78A36DA12AF5761E00CBFD43 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */; };
1213
7ACDFB0E1E8944C400BE2D00 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */; };
@@ -94,6 +95,7 @@
9495
isa = PBXFrameworksBuildPhase;
9596
buildActionMask = 2147483647;
9697
files = (
98+
403C71302C66A2E50034A230 /* OCMock in Frameworks */,
9799
C56D3B06A42F3B35C1F47A43 /* libPods-RunnerTests.a in Frameworks */,
98100
);
99101
runOnlyForDeploymentPostprocessing = 0;
@@ -245,6 +247,9 @@
245247
F76AC1A82666D0540040C8BC /* PBXTargetDependency */,
246248
);
247249
name = RunnerTests;
250+
packageProductDependencies = (
251+
403C712F2C66A2E50034A230 /* OCMock */,
252+
);
248253
productName = RunnerTests;
249254
productReference = F76AC1A22666D0540040C8BC /* RunnerTests.xctest */;
250255
productType = "com.apple.product-type.bundle.unit-test";
@@ -300,6 +305,9 @@
300305
Base,
301306
);
302307
mainGroup = 97C146E51CF9000F007C117D;
308+
packageReferences = (
309+
403C712E2C66A2E50034A230 /* XCRemoteSwiftPackageReference "ocmock" */,
310+
);
303311
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
304312
projectDirPath = "";
305313
projectRoot = "";
@@ -766,6 +774,25 @@
766774
defaultConfigurationName = Release;
767775
};
768776
/* End XCConfigurationList section */
777+
778+
/* Begin XCRemoteSwiftPackageReference section */
779+
403C712E2C66A2E50034A230 /* XCRemoteSwiftPackageReference "ocmock" */ = {
780+
isa = XCRemoteSwiftPackageReference;
781+
repositoryURL = "https://github.com/erikdoe/ocmock";
782+
requirement = {
783+
kind = revision;
784+
revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d;
785+
};
786+
};
787+
/* End XCRemoteSwiftPackageReference section */
788+
789+
/* Begin XCSwiftPackageProductDependency section */
790+
403C712F2C66A2E50034A230 /* OCMock */ = {
791+
isa = XCSwiftPackageProductDependency;
792+
package = 403C712E2C66A2E50034A230 /* XCRemoteSwiftPackageReference "ocmock" */;
793+
productName = OCMock;
794+
};
795+
/* End XCSwiftPackageProductDependency section */
769796
};
770797
rootObject = 97C146E61CF9000F007C117D /* Project object */;
771798
}

packages/google_sign_in/google_sign_in_ios/example/macos/Podfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ target 'Runner' do
3434
target 'RunnerTests' do
3535
inherit! :search_paths
3636
end
37-
38-
pod 'OCMock','3.5'
3937
end
4038

4139
post_install do |installer|

packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
2929
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
3030
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
31+
403C71332C66A4F70034A230 /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 403C71322C66A4F70034A230 /* OCMock */; };
3132
D7B8415A3D20001DE212873D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A19720E5189178660264EC3F /* Pods_Runner.framework */; };
3233
F107B1B7E4ECB85727EC4286 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BD1DCE969A7E7C76D9CF93C /* Pods_RunnerTests.framework */; };
3334
/* End PBXBuildFile section */
@@ -97,6 +98,7 @@
9798
isa = PBXFrameworksBuildPhase;
9899
buildActionMask = 2147483647;
99100
files = (
101+
403C71332C66A4F70034A230 /* OCMock in Frameworks */,
100102
F107B1B7E4ECB85727EC4286 /* Pods_RunnerTests.framework in Frameworks */,
101103
);
102104
runOnlyForDeploymentPostprocessing = 0;
@@ -229,6 +231,9 @@
229231
331C80DA294CF71000263BE5 /* PBXTargetDependency */,
230232
);
231233
name = RunnerTests;
234+
packageProductDependencies = (
235+
403C71322C66A4F70034A230 /* OCMock */,
236+
);
232237
productName = RunnerTests;
233238
productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;
234239
productType = "com.apple.product-type.bundle.unit-test";
@@ -294,6 +299,9 @@
294299
Base,
295300
);
296301
mainGroup = 33CC10E42044A3C60003C045;
302+
packageReferences = (
303+
403C71312C66A4F70034A230 /* XCRemoteSwiftPackageReference "ocmock" */,
304+
);
297305
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
298306
projectDirPath = "";
299307
projectRoot = "";
@@ -790,6 +798,25 @@
790798
defaultConfigurationName = Release;
791799
};
792800
/* End XCConfigurationList section */
801+
802+
/* Begin XCRemoteSwiftPackageReference section */
803+
403C71312C66A4F70034A230 /* XCRemoteSwiftPackageReference "ocmock" */ = {
804+
isa = XCRemoteSwiftPackageReference;
805+
repositoryURL = "https://github.com/erikdoe/ocmock";
806+
requirement = {
807+
kind = revision;
808+
revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d;
809+
};
810+
};
811+
/* End XCRemoteSwiftPackageReference section */
812+
813+
/* Begin XCSwiftPackageProductDependency section */
814+
403C71322C66A4F70034A230 /* OCMock */ = {
815+
isa = XCSwiftPackageProductDependency;
816+
package = 403C71312C66A4F70034A230 /* XCRemoteSwiftPackageReference "ocmock" */;
817+
productName = OCMock;
818+
};
819+
/* End XCSwiftPackageProductDependency section */
793820
};
794821
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
795822
}

packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import Cocoa
66
import FlutterMacOS
77

8-
@NSApplicationMain
8+
@main
99
class AppDelegate: FlutterAppDelegate {
1010
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
1111
return true

packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import 'package:pigeon/pigeon.dart';
77
@ConfigurePigeon(PigeonOptions(
88
dartOut: 'lib/src/messages.g.dart',
99
objcOptions: ObjcOptions(prefix: 'FSI'),
10-
objcHeaderOut: 'darwin/Classes/messages.g.h',
11-
objcSourceOut: 'darwin/Classes/messages.g.m',
10+
objcHeaderOut: 'darwin/google_sign_in_ios/Sources/google_sign_in/include/google_sign_in/messages.g.h',
11+
objcSourceOut: 'darwin/google_sign_in_ios/Sources/google_sign_in/messages.g.m',
12+
objcOptions: ObjcOptions(
13+
headerIncludePath: './include/google_sign_in/messages.g.h',
14+
),
1215
copyrightHeader: 'pigeons/copyright.txt',
1316
))
1417

0 commit comments

Comments
 (0)