Skip to content

Commit 435163f

Browse files
committed
deps: Add share_plus plugin, for sharing from Zulip to other apps
This plugin seems to work fine so far. When using its main API, `Share.share()`, on iOS, I get some log output that could be noise, and also some that might hint at some layout glitches but that I haven't noticed as being user-visible: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20.60share_plus.60/near/1506606 Here's what I did to install: - Added the new dependency line to pubspec.yaml - Ran `flutter pub get` - Tried to build/run on my iPhone, and in the `pod install` phase, got this error: [!] Automatically assigning platform `iOS` with version `11.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform` and fixed by uncommenting the `platform` line in ios/Podfile - Tried to build/run on my iPhone, and in the `pod install` phase, got a different error: [!] Unable to find a target named `RunnerTests` in project `Runner.xcodeproj`, did find `Runner`. and fixed by removing a `target 'RunnerTests' do` block in the iOS and macOS Podfiles. Those blocks were added because of flutter/flutter@2a502363e, which we recently took when upgrading to the Flutter beta 3.8.0-10.1.pre. We were missing new iOS code that those blocks refer to, added in that same Flutter commit. There doesn't seem to be an automatic step that would give us that code, but docs are in the works if we ever want to add it manually: flutter/flutter#96421 (comment) Anyway, it doesn't seem like a lot of code; probably a simple "Hello World" example. Leave it out for now, but cleanly, by deleting those dangling references in the Podfiles. - Built and ran successfully on my iPhone; the `pod install` phase succeeded, generating ios/Podfile.lock and adding reasonable-looking lines in some Xcode files in ios/ (CocoaPods stuff). - (Same with macOS, for the files in macos/.)
1 parent 84ebc01 commit 435163f

19 files changed

+462
-3
lines changed

ios/Flutter/Debug.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

ios/Flutter/Release.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

ios/Podfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :ios, '11.0'
2+
3+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5+
6+
project 'Runner', {
7+
'Debug' => :debug,
8+
'Profile' => :release,
9+
'Release' => :release,
10+
}
11+
12+
def flutter_root
13+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
14+
unless File.exist?(generated_xcode_build_settings_path)
15+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
16+
end
17+
18+
File.foreach(generated_xcode_build_settings_path) do |line|
19+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
20+
return matches[1].strip if matches
21+
end
22+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
23+
end
24+
25+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26+
27+
flutter_ios_podfile_setup
28+
29+
target 'Runner' do
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
34+
end
35+
36+
post_install do |installer|
37+
installer.pods_project.targets.each do |target|
38+
flutter_additional_ios_build_settings(target)
39+
end
40+
end

ios/Podfile.lock

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
- path_provider_foundation (0.0.1):
4+
- Flutter
5+
- FlutterMacOS
6+
- share_plus (0.0.1):
7+
- Flutter
8+
9+
DEPENDENCIES:
10+
- Flutter (from `Flutter`)
11+
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
12+
- share_plus (from `.symlinks/plugins/share_plus/ios`)
13+
14+
EXTERNAL SOURCES:
15+
Flutter:
16+
:path: Flutter
17+
path_provider_foundation:
18+
:path: ".symlinks/plugins/path_provider_foundation/darwin"
19+
share_plus:
20+
:path: ".symlinks/plugins/share_plus/ios"
21+
22+
SPEC CHECKSUMS:
23+
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
24+
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
25+
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
26+
27+
PODFILE CHECKSUM: 985e5b058f26709dc81f9ae74ea2b2775bdbcefe
28+
29+
COCOAPODS: 1.11.3

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1414
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1515
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16+
F311C174AF9C005CE4AADD72 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EAE3F3F518B95B7BFEB4FE7 /* Pods_Runner.framework */; };
1617
/* End PBXBuildFile section */
1718

1819
/* Begin PBXCopyFilesBuildPhase section */
@@ -31,9 +32,13 @@
3132
/* Begin PBXFileReference section */
3233
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3334
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35+
157DB5307E82FD55510A52F6 /* 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>"; };
3436
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
37+
3EAE3F3F518B95B7BFEB4FE7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
38+
4541FE48FEFD549440B32652 /* 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>"; };
3539
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3640
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
41+
7A94C3F14B90E7FC7BC4B082 /* 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>"; };
3742
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
3843
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
3944
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -49,12 +54,24 @@
4954
isa = PBXFrameworksBuildPhase;
5055
buildActionMask = 2147483647;
5156
files = (
57+
F311C174AF9C005CE4AADD72 /* Pods_Runner.framework in Frameworks */,
5258
);
5359
runOnlyForDeploymentPostprocessing = 0;
5460
};
5561
/* End PBXFrameworksBuildPhase section */
5662

5763
/* Begin PBXGroup section */
64+
876166F6347BF9C555764E5A /* Pods */ = {
65+
isa = PBXGroup;
66+
children = (
67+
157DB5307E82FD55510A52F6 /* Pods-Runner.debug.xcconfig */,
68+
4541FE48FEFD549440B32652 /* Pods-Runner.release.xcconfig */,
69+
7A94C3F14B90E7FC7BC4B082 /* Pods-Runner.profile.xcconfig */,
70+
);
71+
name = Pods;
72+
path = Pods;
73+
sourceTree = "<group>";
74+
};
5875
9740EEB11CF90186004384FC /* Flutter */ = {
5976
isa = PBXGroup;
6077
children = (
@@ -72,6 +89,8 @@
7289
9740EEB11CF90186004384FC /* Flutter */,
7390
97C146F01CF9000F007C117D /* Runner */,
7491
97C146EF1CF9000F007C117D /* Products */,
92+
876166F6347BF9C555764E5A /* Pods */,
93+
DE33BFABA662D9225C39B5E5 /* Frameworks */,
7594
);
7695
sourceTree = "<group>";
7796
};
@@ -98,19 +117,29 @@
98117
path = Runner;
99118
sourceTree = "<group>";
100119
};
120+
DE33BFABA662D9225C39B5E5 /* Frameworks */ = {
121+
isa = PBXGroup;
122+
children = (
123+
3EAE3F3F518B95B7BFEB4FE7 /* Pods_Runner.framework */,
124+
);
125+
name = Frameworks;
126+
sourceTree = "<group>";
127+
};
101128
/* End PBXGroup section */
102129

103130
/* Begin PBXNativeTarget section */
104131
97C146ED1CF9000F007C117D /* Runner */ = {
105132
isa = PBXNativeTarget;
106133
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107134
buildPhases = (
135+
6B657AD6067C1F92BC2172DC /* [CP] Check Pods Manifest.lock */,
108136
9740EEB61CF901F6004384FC /* Run Script */,
109137
97C146EA1CF9000F007C117D /* Sources */,
110138
97C146EB1CF9000F007C117D /* Frameworks */,
111139
97C146EC1CF9000F007C117D /* Resources */,
112140
9705A1C41CF9048500538489 /* Embed Frameworks */,
113141
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142+
CF082B7052F068E927BF3A60 /* [CP] Embed Pods Frameworks */,
114143
);
115144
buildRules = (
116145
);
@@ -185,6 +214,28 @@
185214
shellPath = /bin/sh;
186215
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
187216
};
217+
6B657AD6067C1F92BC2172DC /* [CP] Check Pods Manifest.lock */ = {
218+
isa = PBXShellScriptBuildPhase;
219+
buildActionMask = 2147483647;
220+
files = (
221+
);
222+
inputFileListPaths = (
223+
);
224+
inputPaths = (
225+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
226+
"${PODS_ROOT}/Manifest.lock",
227+
);
228+
name = "[CP] Check Pods Manifest.lock";
229+
outputFileListPaths = (
230+
);
231+
outputPaths = (
232+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
233+
);
234+
runOnlyForDeploymentPostprocessing = 0;
235+
shellPath = /bin/sh;
236+
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";
237+
showEnvVarsInLog = 0;
238+
};
188239
9740EEB61CF901F6004384FC /* Run Script */ = {
189240
isa = PBXShellScriptBuildPhase;
190241
alwaysOutOfDate = 1;
@@ -200,6 +251,23 @@
200251
shellPath = /bin/sh;
201252
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
202253
};
254+
CF082B7052F068E927BF3A60 /* [CP] Embed Pods Frameworks */ = {
255+
isa = PBXShellScriptBuildPhase;
256+
buildActionMask = 2147483647;
257+
files = (
258+
);
259+
inputFileListPaths = (
260+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
261+
);
262+
name = "[CP] Embed Pods Frameworks";
263+
outputFileListPaths = (
264+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
265+
);
266+
runOnlyForDeploymentPostprocessing = 0;
267+
shellPath = /bin/sh;
268+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
269+
showEnvVarsInLog = 0;
270+
};
203271
/* End PBXShellScriptBuildPhase section */
204272

205273
/* Begin PBXSourcesBuildPhase section */

ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

linux/flutter/generated_plugin_registrant.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
#include "generated_plugin_registrant.h"
88

9+
#include <url_launcher_linux/url_launcher_plugin.h>
910

1011
void fl_register_plugins(FlPluginRegistry* registry) {
12+
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
13+
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
14+
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
1115
}

linux/flutter/generated_plugins.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44

55
list(APPEND FLUTTER_PLUGIN_LIST
6+
url_launcher_linux
67
)
78

89
list(APPEND FLUTTER_FFI_PLUGIN_LIST

macos/Flutter/Flutter-Debug.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "ephemeral/Flutter-Generated.xcconfig"

macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import FlutterMacOS
66
import Foundation
77

8+
import path_provider_foundation
9+
import share_plus
810

911
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
12+
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
13+
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
1014
}

macos/Podfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :osx, '10.14'
2+
3+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5+
6+
project 'Runner', {
7+
'Debug' => :debug,
8+
'Profile' => :release,
9+
'Release' => :release,
10+
}
11+
12+
def flutter_root
13+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14+
unless File.exist?(generated_xcode_build_settings_path)
15+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16+
end
17+
18+
File.foreach(generated_xcode_build_settings_path) do |line|
19+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
20+
return matches[1].strip if matches
21+
end
22+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23+
end
24+
25+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26+
27+
flutter_macos_podfile_setup
28+
29+
target 'Runner' do
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34+
end
35+
36+
post_install do |installer|
37+
installer.pods_project.targets.each do |target|
38+
flutter_additional_macos_build_settings(target)
39+
end
40+
end

macos/Podfile.lock

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PODS:
2+
- FlutterMacOS (1.0.0)
3+
- path_provider_foundation (0.0.1):
4+
- Flutter
5+
- FlutterMacOS
6+
- share_plus (0.0.1):
7+
- FlutterMacOS
8+
9+
DEPENDENCIES:
10+
- FlutterMacOS (from `Flutter/ephemeral`)
11+
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
12+
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
13+
14+
EXTERNAL SOURCES:
15+
FlutterMacOS:
16+
:path: Flutter/ephemeral
17+
path_provider_foundation:
18+
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
19+
share_plus:
20+
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
21+
22+
SPEC CHECKSUMS:
23+
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
24+
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
25+
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
26+
27+
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
28+
29+
COCOAPODS: 1.11.3

0 commit comments

Comments
 (0)