Skip to content

Commit 45bcc32

Browse files
authored
[various] Add Swift Package Manager integration to Google sign in example apps (#8230)
This migrates the following plugins' example apps to have Swift Package Manager integration: 1. google_sign_in 2. google_sign_in_ios This also checks-in CocoaPods integration stuff that was missing. This raises the example apps' Flutter SDK requirement to 3.24.0 or higher. I will get a text exemption for this change. The example apps were migrated using the following commands: ``` dart run script/tool/bin/flutter_plugin_tools.dart build-examples --ios --swift-package-manager dart run script/tool/bin/flutter_plugin_tools.dart build-examples --macos --swift-package-manager ``` Completes: flutter/flutter#159173
1 parent 824d91a commit 45bcc32

File tree

8 files changed

+150
-6
lines changed

8 files changed

+150
-6
lines changed

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
5C6F5A6E1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */; };
11+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1112
7ACDFB0E1E8944C400BE2D00 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */; };
1213
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1314
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
@@ -58,6 +59,7 @@
5859
isa = PBXFrameworksBuildPhase;
5960
buildActionMask = 2147483647;
6061
files = (
62+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
6163
C2FB9CBA01DB0A2DE5F31E12 /* libPods-Runner.a in Frameworks */,
6264
);
6365
runOnlyForDeploymentPostprocessing = 0;
@@ -160,6 +162,9 @@
160162
dependencies = (
161163
);
162164
name = Runner;
165+
packageProductDependencies = (
166+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
167+
);
163168
productName = Runner;
164169
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
165170
productType = "com.apple.product-type.application";
@@ -170,7 +175,7 @@
170175
97C146E61CF9000F007C117D /* Project object */ = {
171176
isa = PBXProject;
172177
attributes = {
173-
LastUpgradeCheck = 1430;
178+
LastUpgradeCheck = 1510;
174179
ORGANIZATIONNAME = "The Flutter Authors";
175180
TargetAttributes = {
176181
97C146ED1CF9000F007C117D = {
@@ -187,6 +192,9 @@
187192
Base,
188193
);
189194
mainGroup = 97C146E51CF9000F007C117D;
195+
packageReferences = (
196+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
197+
);
190198
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
191199
projectDirPath = "";
192200
projectRoot = "";
@@ -234,11 +242,19 @@
234242
);
235243
inputPaths = (
236244
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
245+
"${PODS_CONFIGURATION_BUILD_DIR}/AppAuth/AppAuthCore_Privacy.bundle",
246+
"${PODS_CONFIGURATION_BUILD_DIR}/GTMAppAuth/GTMAppAuth_Privacy.bundle",
247+
"${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher/GTMSessionFetcher_Core_Privacy.bundle",
248+
"${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher/GTMSessionFetcher_Full_Privacy.bundle",
237249
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleSignIn/GoogleSignIn.bundle",
238250
"${PODS_CONFIGURATION_BUILD_DIR}/google_sign_in_ios/google_sign_in_ios_privacy.bundle",
239251
);
240252
name = "[CP] Copy Pods Resources";
241253
outputPaths = (
254+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AppAuthCore_Privacy.bundle",
255+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMAppAuth_Privacy.bundle",
256+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMSessionFetcher_Core_Privacy.bundle",
257+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMSessionFetcher_Full_Privacy.bundle",
242258
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle",
243259
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/google_sign_in_ios_privacy.bundle",
244260
);
@@ -491,6 +507,20 @@
491507
defaultConfigurationName = Release;
492508
};
493509
/* End XCConfigurationList section */
510+
511+
/* Begin XCLocalSwiftPackageReference section */
512+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
513+
isa = XCLocalSwiftPackageReference;
514+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
515+
};
516+
/* End XCLocalSwiftPackageReference section */
517+
518+
/* Begin XCSwiftPackageProductDependency section */
519+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
520+
isa = XCSwiftPackageProductDependency;
521+
productName = FlutterGeneratedPluginSwiftPackage;
522+
};
523+
/* End XCSwiftPackageProductDependency section */
494524
};
495525
rootObject = 97C146E61CF9000F007C117D /* Project object */;
496526
}

packages/google_sign_in/google_sign_in/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"
@@ -68,6 +86,7 @@
6886
ignoresPersistentStateOnLaunch = "NO"
6987
debugDocumentVersioning = "YES"
7088
debugServiceExtension = "internal"
89+
enableGPUValidationMode = "1"
7190
allowLocationSimulation = "YES">
7291
<BuildableProductRunnable
7392
runnableDebuggingMode = "0">

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

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@
191191
33CC10EB2044A3C60003C045 /* Resources */,
192192
33CC110E2044A8840003C045 /* Bundle Framework */,
193193
3399D490228B24CF009A79C7 /* ShellScript */,
194+
CDA781BB611B257CD4D32B4D /* [CP] Embed Pods Frameworks */,
195+
5845DE94A5B9AC1E93542D07 /* [CP] Copy Pods Resources */,
194196
);
195197
buildRules = (
196198
);
@@ -209,7 +211,7 @@
209211
isa = PBXProject;
210212
attributes = {
211213
LastSwiftUpdateCheck = 0920;
212-
LastUpgradeCheck = 1430;
214+
LastUpgradeCheck = 1510;
213215
ORGANIZATIONNAME = "";
214216
TargetAttributes = {
215217
33CC10EC2044A3C60003C045 = {
@@ -298,6 +300,40 @@
298300
shellPath = /bin/sh;
299301
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
300302
};
303+
5845DE94A5B9AC1E93542D07 /* [CP] Copy Pods Resources */ = {
304+
isa = PBXShellScriptBuildPhase;
305+
buildActionMask = 2147483647;
306+
files = (
307+
);
308+
inputFileListPaths = (
309+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
310+
);
311+
name = "[CP] Copy Pods Resources";
312+
outputFileListPaths = (
313+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
314+
);
315+
runOnlyForDeploymentPostprocessing = 0;
316+
shellPath = /bin/sh;
317+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
318+
showEnvVarsInLog = 0;
319+
};
320+
CDA781BB611B257CD4D32B4D /* [CP] Embed Pods Frameworks */ = {
321+
isa = PBXShellScriptBuildPhase;
322+
buildActionMask = 2147483647;
323+
files = (
324+
);
325+
inputFileListPaths = (
326+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
327+
);
328+
name = "[CP] Embed Pods Frameworks";
329+
outputFileListPaths = (
330+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
331+
);
332+
runOnlyForDeploymentPostprocessing = 0;
333+
shellPath = /bin/sh;
334+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
335+
showEnvVarsInLog = 0;
336+
};
301337
DD22313F1BC2623931943E8D /* [CP] Check Pods Manifest.lock */ = {
302338
isa = PBXShellScriptBuildPhase;
303339
buildActionMask = 2147483647;

packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -59,6 +59,7 @@
5959
ignoresPersistentStateOnLaunch = "NO"
6060
debugDocumentVersioning = "YES"
6161
debugServiceExtension = "internal"
62+
enableGPUValidationMode = "1"
6263
allowLocationSimulation = "YES">
6364
<BuildableProductRunnable
6465
runnableDebuggingMode = "0">

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
C56D3B06A42F3B35C1F47A43 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18AD6475292B9C45B529DDC9 /* libPods-RunnerTests.a */; };
2020
F76AC1A52666D0540040C8BC /* GoogleSignInTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F76AC1A42666D0540040C8BC /* GoogleSignInTests.m */; };
2121
F76AC1B32666D0610040C8BC /* GoogleSignInUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = F76AC1B22666D0610040C8BC /* GoogleSignInUITests.m */; };
22+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
2223
/* End PBXBuildFile section */
2324

2425
/* Begin PBXContainerItemProxy section */
@@ -86,6 +87,7 @@
8687
isa = PBXFrameworksBuildPhase;
8788
buildActionMask = 2147483647;
8889
files = (
90+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
8991
C2FB9CBA01DB0A2DE5F31E12 /* libPods-Runner.a in Frameworks */,
9092
);
9193
runOnlyForDeploymentPostprocessing = 0;
@@ -209,6 +211,9 @@
209211

210212
/* Begin PBXNativeTarget section */
211213
97C146ED1CF9000F007C117D /* Runner */ = {
214+
packageProductDependencies = (
215+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
216+
);
212217
isa = PBXNativeTarget;
213218
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
214219
buildPhases = (
@@ -271,6 +276,9 @@
271276

272277
/* Begin PBXProject section */
273278
97C146E61CF9000F007C117D /* Project object */ = {
279+
packageReferences = (
280+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
281+
);
274282
isa = PBXProject;
275283
attributes = {
276284
LastUpgradeCheck = 1510;
@@ -766,6 +774,18 @@
766774
defaultConfigurationName = Release;
767775
};
768776
/* End XCConfigurationList section */
777+
/* Begin XCLocalSwiftPackageReference section */
778+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
779+
isa = XCLocalSwiftPackageReference;
780+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
781+
};
782+
/* End XCLocalSwiftPackageReference section */
783+
/* Begin XCSwiftPackageProductDependency section */
784+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
785+
isa = XCSwiftPackageProductDependency;
786+
productName = FlutterGeneratedPluginSwiftPackage;
787+
};
788+
/* End XCSwiftPackageProductDependency section */
769789
};
770790
rootObject = 97C146E61CF9000F007C117D /* Project object */;
771791
}

packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"
@@ -68,6 +86,7 @@
6886
ignoresPersistentStateOnLaunch = "NO"
6987
debugDocumentVersioning = "YES"
7088
debugServiceExtension = "internal"
89+
enableGPUValidationMode = "1"
7190
allowLocationSimulation = "YES">
7291
<BuildableProductRunnable
7392
runnableDebuggingMode = "0">

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
33CC110E2044A8840003C045 /* Bundle Framework */,
245245
3399D490228B24CF009A79C7 /* ShellScript */,
246246
71BCCDB30AA132D041139429 /* [CP] Embed Pods Frameworks */,
247+
869627441CAFE5E045BD46CA /* [CP] Copy Pods Resources */,
247248
);
248249
buildRules = (
249250
);
@@ -262,7 +263,7 @@
262263
isa = PBXProject;
263264
attributes = {
264265
LastSwiftUpdateCheck = 0920;
265-
LastUpgradeCheck = 1430;
266+
LastUpgradeCheck = 1510;
266267
ORGANIZATIONNAME = "";
267268
TargetAttributes = {
268269
331C80D4294CF70F00263BE5 = {
@@ -425,6 +426,23 @@
425426
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
426427
showEnvVarsInLog = 0;
427428
};
429+
869627441CAFE5E045BD46CA /* [CP] Copy Pods Resources */ = {
430+
isa = PBXShellScriptBuildPhase;
431+
buildActionMask = 2147483647;
432+
files = (
433+
);
434+
inputFileListPaths = (
435+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
436+
);
437+
name = "[CP] Copy Pods Resources";
438+
outputFileListPaths = (
439+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
440+
);
441+
runOnlyForDeploymentPostprocessing = 0;
442+
shellPath = /bin/sh;
443+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
444+
showEnvVarsInLog = 0;
445+
};
428446
/* End PBXShellScriptBuildPhase section */
429447

430448
/* Begin PBXSourcesBuildPhase section */

packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -59,6 +59,7 @@
5959
ignoresPersistentStateOnLaunch = "NO"
6060
debugDocumentVersioning = "YES"
6161
debugServiceExtension = "internal"
62+
enableGPUValidationMode = "1"
6263
allowLocationSimulation = "YES">
6364
<BuildableProductRunnable
6465
runnableDebuggingMode = "0">

0 commit comments

Comments
 (0)