Skip to content

Commit 3ddeae4

Browse files
chore: add swift package manager support (#2327)
### DESCRIPTION - Added SPM support for iOS & MacOS. - Closes #2274
1 parent a7a5a01 commit 3ddeae4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+298
-78
lines changed

example/ios/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ Runner/GeneratedPluginRegistrant.*
3434
!default.perspectivev3
3535

3636
Podfile.lock
37+
swiftpm

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
71BBA3BA28AB50E2007B0DBC /* ReplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71BBA3B928AB50E2007B0DBC /* ReplayKit.framework */; };
1414
71BBA3BE28AB50E2007B0DBC /* SampleHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BBA3BD28AB50E2007B0DBC /* SampleHandler.m */; };
1515
71BBA3C228AB50E2007B0DBC /* ScreenSharing.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 71BBA3B828AB50E2007B0DBC /* ScreenSharing.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
16+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1617
84969AB62B3ABD9500A81666 /* VideoRawDataController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84969AB52B3ABD9500A81666 /* VideoRawDataController.m */; };
1718
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1819
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
@@ -102,6 +103,7 @@
102103
isa = PBXFrameworksBuildPhase;
103104
buildActionMask = 2147483647;
104105
files = (
106+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
105107
9DA4854253E6947D845E2F5D /* Pods_Runner.framework in Frameworks */,
106108
);
107109
runOnlyForDeploymentPostprocessing = 0;
@@ -226,21 +228,24 @@
226228
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
227229
buildPhases = (
228230
7E1B0C30D51B77496A1AE2E1 /* [CP] Check Pods Manifest.lock */,
229-
39CD36047290E845D66DC420 /* [CP] Embed Pods Frameworks */,
230231
71BBA3C328AB50E2007B0DBC /* Embed App Extensions */,
231232
9740EEB61CF901F6004384FC /* Run Script */,
232233
97C146EA1CF9000F007C117D /* Sources */,
233234
97C146EB1CF9000F007C117D /* Frameworks */,
234235
97C146EC1CF9000F007C117D /* Resources */,
235236
9705A1C41CF9048500538489 /* Embed Frameworks */,
236237
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
238+
8E36E3602A499E91F7A0D9EC /* [CP] Embed Pods Frameworks */,
237239
);
238240
buildRules = (
239241
);
240242
dependencies = (
241243
71BBA3C128AB50E2007B0DBC /* PBXTargetDependency */,
242244
);
243245
name = Runner;
246+
packageProductDependencies = (
247+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
248+
);
244249
productName = Runner;
245250
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
246251
productType = "com.apple.product-type.application";
@@ -271,6 +276,9 @@
271276
Base,
272277
);
273278
mainGroup = 97C146E51CF9000F007C117D;
279+
packageReferences = (
280+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
281+
);
274282
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
275283
projectDirPath = "";
276284
projectRoot = "";
@@ -303,23 +311,6 @@
303311
/* End PBXResourcesBuildPhase section */
304312

305313
/* Begin PBXShellScriptBuildPhase section */
306-
39CD36047290E845D66DC420 /* [CP] Embed Pods Frameworks */ = {
307-
isa = PBXShellScriptBuildPhase;
308-
buildActionMask = 2147483647;
309-
files = (
310-
);
311-
inputFileListPaths = (
312-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
313-
);
314-
name = "[CP] Embed Pods Frameworks";
315-
outputFileListPaths = (
316-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
317-
);
318-
runOnlyForDeploymentPostprocessing = 0;
319-
shellPath = /bin/sh;
320-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
321-
showEnvVarsInLog = 0;
322-
};
323314
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
324315
isa = PBXShellScriptBuildPhase;
325316
alwaysOutOfDate = 1;
@@ -358,6 +349,23 @@
358349
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";
359350
showEnvVarsInLog = 0;
360351
};
352+
8E36E3602A499E91F7A0D9EC /* [CP] Embed Pods Frameworks */ = {
353+
isa = PBXShellScriptBuildPhase;
354+
buildActionMask = 2147483647;
355+
files = (
356+
);
357+
inputFileListPaths = (
358+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
359+
);
360+
name = "[CP] Embed Pods Frameworks";
361+
outputFileListPaths = (
362+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
363+
);
364+
runOnlyForDeploymentPostprocessing = 0;
365+
shellPath = /bin/sh;
366+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
367+
showEnvVarsInLog = 0;
368+
};
361369
9740EEB61CF901F6004384FC /* Run Script */ = {
362370
isa = PBXShellScriptBuildPhase;
363371
alwaysOutOfDate = 1;
@@ -825,6 +833,20 @@
825833
defaultConfigurationName = Release;
826834
};
827835
/* End XCConfigurationList section */
836+
837+
/* Begin XCLocalSwiftPackageReference section */
838+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
839+
isa = XCLocalSwiftPackageReference;
840+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
841+
};
842+
/* End XCLocalSwiftPackageReference section */
843+
844+
/* Begin XCSwiftPackageProductDependency section */
845+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
846+
isa = XCSwiftPackageProductDependency;
847+
productName = FlutterGeneratedPluginSwiftPackage;
848+
};
849+
/* End XCSwiftPackageProductDependency section */
828850
};
829851
rootObject = 97C146E61CF9000F007C117D /* Project object */;
830852
}

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

Lines changed: 21 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"
@@ -26,6 +44,7 @@
2644
buildConfiguration = "Debug"
2745
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2846
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2948
shouldUseLaunchSchemeArgsEnv = "YES">
3049
<MacroExpansion>
3150
<BuildableReference
@@ -43,11 +62,13 @@
4362
buildConfiguration = "Debug"
4463
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4564
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
65+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4666
launchStyle = "0"
4767
useCustomWorkingDirectory = "NO"
4868
ignoresPersistentStateOnLaunch = "NO"
4969
debugDocumentVersioning = "YES"
5070
debugServiceExtension = "internal"
71+
enableGPUValidationMode = "1"
5172
allowLocationSimulation = "YES">
5273
<BuildableProductRunnable
5374
runnableDebuggingMode = "0">

example/macos/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
**/dgph
77
**/xcuserdata/
88
Podfile.lock
9+
swiftpm

0 commit comments

Comments
 (0)