Skip to content

Commit 8d0b608

Browse files
authored
[desktop_drop]: Remove warnings, migrate macOS plugin to SPM, and regenerate example for web (#403)
* updated macos project * macos migration * removed cocoapods from macos project * Regenerated web project
1 parent 6c2845f commit 8d0b608

File tree

15 files changed

+106
-169
lines changed

15 files changed

+106
-169
lines changed

packages/desktop_drop/example/.metadata

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 01e10e793e2459e9e563d5f928e40452aecd80cc
8-
channel: master
7+
revision: "c23637390482d4cf9598c3ce3f2be31aa7332daf"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
17+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
18+
- platform: web
19+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
20+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
21
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
21
#include "ephemeral/Flutter-Generated.xcconfig"

packages/desktop_drop/example/macos/Podfile

Lines changed: 0 additions & 40 deletions
This file was deleted.

packages/desktop_drop/example/macos/Podfile.lock

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 22 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
2727
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
2828
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
29-
7F93B8DF55C23585E8C7FC80 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2AB02491CCC3DA14B1682F2 /* Pods_Runner.framework */; };
29+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
3030
/* End PBXBuildFile section */
3131

3232
/* Begin PBXContainerItemProxy section */
@@ -53,7 +53,6 @@
5353
/* End PBXCopyFilesBuildPhase section */
5454

5555
/* Begin PBXFileReference section */
56-
1EAB4EFABC0020C99A5E6EE5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
5756
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
5857
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
5958
33CC10ED2044A3C60003C045 /* desktop_drop_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = desktop_drop_example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -68,19 +67,16 @@
6867
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
6968
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
7069
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
71-
79D1ABD8CD8F69FB7CE33E8C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
7270
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
7371
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
74-
B2AB02491CCC3DA14B1682F2 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
75-
BBC5FF85C6C649BFDDAB61AE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
7672
/* End PBXFileReference section */
7773

7874
/* Begin PBXFrameworksBuildPhase section */
7975
33CC10EA2044A3C60003C045 /* Frameworks */ = {
8076
isa = PBXFrameworksBuildPhase;
8177
buildActionMask = 2147483647;
8278
files = (
83-
7F93B8DF55C23585E8C7FC80 /* Pods_Runner.framework in Frameworks */,
79+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
8480
);
8581
runOnlyForDeploymentPostprocessing = 0;
8682
};
@@ -104,8 +100,6 @@
104100
33FAB671232836740065AC1E /* Runner */,
105101
33CEB47122A05771004F2AC0 /* Flutter */,
106102
33CC10EE2044A3C60003C045 /* Products */,
107-
D73912EC22F37F3D000D13A0 /* Frameworks */,
108-
486033EBA7F1611C8978222E /* Pods */,
109103
);
110104
sourceTree = "<group>";
111105
};
@@ -152,46 +146,28 @@
152146
path = Runner;
153147
sourceTree = "<group>";
154148
};
155-
486033EBA7F1611C8978222E /* Pods */ = {
156-
isa = PBXGroup;
157-
children = (
158-
1EAB4EFABC0020C99A5E6EE5 /* Pods-Runner.debug.xcconfig */,
159-
79D1ABD8CD8F69FB7CE33E8C /* Pods-Runner.release.xcconfig */,
160-
BBC5FF85C6C649BFDDAB61AE /* Pods-Runner.profile.xcconfig */,
161-
);
162-
name = Pods;
163-
path = Pods;
164-
sourceTree = "<group>";
165-
};
166-
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
167-
isa = PBXGroup;
168-
children = (
169-
B2AB02491CCC3DA14B1682F2 /* Pods_Runner.framework */,
170-
);
171-
name = Frameworks;
172-
sourceTree = "<group>";
173-
};
174149
/* End PBXGroup section */
175150

176151
/* Begin PBXNativeTarget section */
177152
33CC10EC2044A3C60003C045 /* Runner */ = {
178153
isa = PBXNativeTarget;
179154
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
180155
buildPhases = (
181-
611B812ADB71405F8B8F553B /* [CP] Check Pods Manifest.lock */,
182156
33CC10E92044A3C60003C045 /* Sources */,
183157
33CC10EA2044A3C60003C045 /* Frameworks */,
184158
33CC10EB2044A3C60003C045 /* Resources */,
185159
33CC110E2044A8840003C045 /* Bundle Framework */,
186160
3399D490228B24CF009A79C7 /* ShellScript */,
187-
CDD1715D9B642681869B9EA6 /* [CP] Embed Pods Frameworks */,
188161
);
189162
buildRules = (
190163
);
191164
dependencies = (
192165
33CC11202044C79F0003C045 /* PBXTargetDependency */,
193166
);
194167
name = Runner;
168+
packageProductDependencies = (
169+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
170+
);
195171
productName = Runner;
196172
productReference = 33CC10ED2044A3C60003C045 /* desktop_drop_example.app */;
197173
productType = "com.apple.product-type.application";
@@ -231,6 +207,9 @@
231207
Base,
232208
);
233209
mainGroup = 33CC10E42044A3C60003C045;
210+
packageReferences = (
211+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
212+
);
234213
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
235214
projectDirPath = "";
236215
projectRoot = "";
@@ -292,45 +271,6 @@
292271
shellPath = /bin/sh;
293272
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
294273
};
295-
611B812ADB71405F8B8F553B /* [CP] Check Pods Manifest.lock */ = {
296-
isa = PBXShellScriptBuildPhase;
297-
buildActionMask = 2147483647;
298-
files = (
299-
);
300-
inputFileListPaths = (
301-
);
302-
inputPaths = (
303-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
304-
"${PODS_ROOT}/Manifest.lock",
305-
);
306-
name = "[CP] Check Pods Manifest.lock";
307-
outputFileListPaths = (
308-
);
309-
outputPaths = (
310-
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
311-
);
312-
runOnlyForDeploymentPostprocessing = 0;
313-
shellPath = /bin/sh;
314-
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";
315-
showEnvVarsInLog = 0;
316-
};
317-
CDD1715D9B642681869B9EA6 /* [CP] Embed Pods Frameworks */ = {
318-
isa = PBXShellScriptBuildPhase;
319-
buildActionMask = 2147483647;
320-
files = (
321-
);
322-
inputFileListPaths = (
323-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
324-
);
325-
name = "[CP] Embed Pods Frameworks";
326-
outputFileListPaths = (
327-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
328-
);
329-
runOnlyForDeploymentPostprocessing = 0;
330-
shellPath = /bin/sh;
331-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
332-
showEnvVarsInLog = 0;
333-
};
334274
/* End PBXShellScriptBuildPhase section */
335275

336276
/* Begin PBXSourcesBuildPhase section */
@@ -628,6 +568,20 @@
628568
defaultConfigurationName = Release;
629569
};
630570
/* End XCConfigurationList section */
571+
572+
/* Begin XCLocalSwiftPackageReference section */
573+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
574+
isa = XCLocalSwiftPackageReference;
575+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
576+
};
577+
/* End XCLocalSwiftPackageReference section */
578+
579+
/* Begin XCSwiftPackageProductDependency section */
580+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
581+
isa = XCSwiftPackageProductDependency;
582+
productName = FlutterGeneratedPluginSwiftPackage;
583+
};
584+
/* End XCSwiftPackageProductDependency section */
631585
};
632586
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
633587
}

packages/desktop_drop/example/macos/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 = "&quot;$FLUTTER_ROOT&quot;/packages/flutter_tools/bin/macos_assemble.sh prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
18+
BuildableName = "desktop_drop_example.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"
@@ -48,6 +66,7 @@
4866
ignoresPersistentStateOnLaunch = "NO"
4967
debugDocumentVersioning = "YES"
5068
debugServiceExtension = "internal"
69+
enableGPUValidationMode = "1"
5170
allowLocationSimulation = "YES">
5271
<BuildableProductRunnable
5372
runnableDebuggingMode = "0">

packages/desktop_drop/example/macos/Runner/AppDelegate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
77
return true
88
}
9+
10+
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
11+
return true
12+
}
913
}

packages/desktop_drop/example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ packages:
6363
path: ".."
6464
relative: true
6565
source: path
66-
version: "0.5.0"
66+
version: "0.5.1"
6767
fake_async:
6868
dependency: transitive
6969
description:

packages/desktop_drop/example/web/index.html

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<meta name="description" content="Demonstrates how to use the desktop_drop plugin.">
2222

2323
<!-- iOS meta tags & icons -->
24-
<meta name="apple-mobile-web-app-capable" content="yes">
24+
<meta name="mobile-web-app-capable" content="yes">
2525
<meta name="apple-mobile-web-app-status-bar-style" content="black">
2626
<meta name="apple-mobile-web-app-title" content="desktop_drop_example">
2727
<link rel="apple-touch-icon" href="icons/Icon-192.png">
@@ -31,29 +31,8 @@
3131

3232
<title>desktop_drop_example</title>
3333
<link rel="manifest" href="manifest.json">
34-
35-
<script>
36-
// The value below is injected by flutter build, do not touch.
37-
const serviceWorkerVersion = null;
38-
</script>
39-
<!-- This script adds the flutter initialization JS code -->
40-
<script src="flutter.js" defer></script>
4134
</head>
4235
<body>
43-
<script>
44-
window.addEventListener('load', function(ev) {
45-
// Download main.dart.js
46-
_flutter.loader.loadEntrypoint({
47-
serviceWorker: {
48-
serviceWorkerVersion: serviceWorkerVersion,
49-
},
50-
onEntrypointLoaded: function(engineInitializer) {
51-
engineInitializer.initializeEngine().then(function(appRunner) {
52-
appRunner.runApp();
53-
});
54-
}
55-
});
56-
});
57-
</script>
36+
<script src="flutter_bootstrap.js" async></script>
5837
</body>
5938
</html>

0 commit comments

Comments
 (0)