Skip to content

Commit

Permalink
[google_sign_in_ios] Adds Swift Package Manager support
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-sharma committed Aug 9, 2024
1 parent f7b1256 commit b359e38
Show file tree
Hide file tree
Showing 18 changed files with 116 additions and 15 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

@import XCTest;
@import google_sign_in_ios;
#if __has_include(<google_sign_in_ios/google_sign_in_ios-umbrella.h>)
@import google_sign_in_ios.Test;
#endif
@import GoogleSignIn;

// OCMock library doesn't generate a valid modulemap.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Enables Google Sign-In in Flutter apps.
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.
Expand All @@ -33,5 +34,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,46 @@
// 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.
.package(
url: "https://github.com/openid/AppAuth-iOS.git",
from: "1.7.4"),
.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
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "FLTGoogleSignInPlugin.h"
#import "FLTGoogleSignInPlugin_Test.h"
#import "./include/google_sign_in_ios/FLTGoogleSignInPlugin.h"
#import "./include/google_sign_in_ios/FLTGoogleSignInPlugin_Test.h"

#import <GoogleSignIn/GoogleSignIn.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Autogenerated from Pigeon (v11.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

#import "messages.g.h"
#import "./include/google_sign_in_ios/messages.g.h"

#if TARGET_OS_OSX
#import <FlutterMacOS/FlutterMacOS.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
403C71302C66A2E50034A230 /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 403C712F2C66A2E50034A230 /* OCMock */; };
5C6F5A6E1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */; };
78A36DA12AF5761E00CBFD43 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */; };
7ACDFB0E1E8944C400BE2D00 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */; };
Expand Down Expand Up @@ -94,6 +95,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
403C71302C66A2E50034A230 /* OCMock in Frameworks */,
C56D3B06A42F3B35C1F47A43 /* libPods-RunnerTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -245,6 +247,9 @@
F76AC1A82666D0540040C8BC /* PBXTargetDependency */,
);
name = RunnerTests;
packageProductDependencies = (
403C712F2C66A2E50034A230 /* OCMock */,
);
productName = RunnerTests;
productReference = F76AC1A22666D0540040C8BC /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
Expand Down Expand Up @@ -300,6 +305,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
403C712E2C66A2E50034A230 /* XCRemoteSwiftPackageReference "ocmock" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -766,6 +774,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
403C712E2C66A2E50034A230 /* XCRemoteSwiftPackageReference "ocmock" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/erikdoe/ocmock";
requirement = {
kind = revision;
revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
403C712F2C66A2E50034A230 /* OCMock */ = {
isa = XCSwiftPackageProductDependency;
package = 403C712E2C66A2E50034A230 /* XCRemoteSwiftPackageReference "ocmock" */;
productName = OCMock;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ target 'Runner' do
target 'RunnerTests' do
inherit! :search_paths
end

pod 'OCMock','3.5'
end

post_install do |installer|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
403C71332C66A4F70034A230 /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 403C71322C66A4F70034A230 /* OCMock */; };
D7B8415A3D20001DE212873D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A19720E5189178660264EC3F /* Pods_Runner.framework */; };
F107B1B7E4ECB85727EC4286 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BD1DCE969A7E7C76D9CF93C /* Pods_RunnerTests.framework */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -97,6 +98,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
403C71332C66A4F70034A230 /* OCMock in Frameworks */,
F107B1B7E4ECB85727EC4286 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -229,6 +231,9 @@
331C80DA294CF71000263BE5 /* PBXTargetDependency */,
);
name = RunnerTests;
packageProductDependencies = (
403C71322C66A4F70034A230 /* OCMock */,
);
productName = RunnerTests;
productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
Expand Down Expand Up @@ -294,6 +299,9 @@
Base,
);
mainGroup = 33CC10E42044A3C60003C045;
packageReferences = (
403C71312C66A4F70034A230 /* XCRemoteSwiftPackageReference "ocmock" */,
);
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -790,6 +798,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
403C71312C66A4F70034A230 /* XCRemoteSwiftPackageReference "ocmock" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/erikdoe/ocmock";
requirement = {
kind = revision;
revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
403C71322C66A4F70034A230 /* OCMock */ = {
isa = XCSwiftPackageProductDependency;
package = 403C71312C66A4F70034A230 /* XCRemoteSwiftPackageReference "ocmock" */;
productName = OCMock;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Cocoa
import FlutterMacOS

@NSApplicationMain
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
objcOptions: ObjcOptions(prefix: 'FSI'),
objcHeaderOut: 'darwin/Classes/messages.g.h',
objcSourceOut: 'darwin/Classes/messages.g.m',
objcHeaderOut: 'darwin/google_sign_in_ios/Sources/google_sign_in/include/google_sign_in/messages.g.h',
objcSourceOut: 'darwin/google_sign_in_ios/Sources/google_sign_in/messages.g.m',
objcOptions: ObjcOptions(
headerIncludePath: './include/google_sign_in/messages.g.h',
),
copyrightHeader: 'pigeons/copyright.txt',
))

Expand Down

0 comments on commit b359e38

Please sign in to comment.