Skip to content

Commit 2af60a8

Browse files
committed
re-generate Podfile
1 parent 5b28228 commit 2af60a8

File tree

4 files changed

+85
-54
lines changed

4 files changed

+85
-54
lines changed

example/ios/Flutter/flutter_export_environment.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# This is a generated file; do not edit or check into version control.
33
export "FLUTTER_ROOT=/Users/hunghd/Documents/Workspace/flutter"
44
export "FLUTTER_APPLICATION_PATH=/Users/hunghd/Documents/Workspace/flutter_packages/flutter_downloader/example"
5-
export "FLUTTER_TARGET=lib/main.dart"
5+
export "FLUTTER_TARGET=/Users/hunghd/Documents/Workspace/flutter_packages/flutter_downloader/example/lib/main.dart"
66
export "FLUTTER_BUILD_DIR=build"
77
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
88
export "FLUTTER_FRAMEWORK_DIR=/Users/hunghd/Documents/Workspace/flutter/bin/cache/artifacts/engine/ios"
99
export "FLUTTER_BUILD_NAME=1.0.0"
1010
export "FLUTTER_BUILD_NUMBER=1"
11+
export "TRACK_WIDGET_CREATION=true"

example/ios/Podfile

Lines changed: 57 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,83 @@
44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
66

7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
713
def parse_KV_file(file, separator='=')
814
file_abs_path = File.expand_path(file)
915
if !File.exists? file_abs_path
1016
return [];
1117
end
12-
pods_ary = []
18+
generated_key_values = {}
1319
skip_line_start_symbols = ["#", "/"]
14-
File.foreach(file_abs_path) { |line|
15-
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
16-
plugin = line.split(pattern=separator)
17-
if plugin.length == 2
18-
podname = plugin[0].strip()
19-
path = plugin[1].strip()
20-
podpath = File.expand_path("#{path}", file_abs_path)
21-
pods_ary.push({:name => podname, :path => podpath});
22-
else
23-
puts "Invalid plugin specification: #{line}"
24-
end
25-
}
26-
return pods_ary
20+
File.foreach(file_abs_path) do |line|
21+
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22+
plugin = line.split(pattern=separator)
23+
if plugin.length == 2
24+
podname = plugin[0].strip()
25+
path = plugin[1].strip()
26+
podpath = File.expand_path("#{path}", file_abs_path)
27+
generated_key_values[podname] = podpath
28+
else
29+
puts "Invalid plugin specification: #{line}"
30+
end
31+
end
32+
generated_key_values
2733
end
2834

2935
target 'Runner' do
30-
use_frameworks!
36+
# Flutter Pod
3137

32-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
33-
# referring to absolute paths on developers' machines.
34-
system('rm -rf .symlinks')
35-
system('mkdir -p .symlinks/plugins')
38+
copied_flutter_dir = File.join(__dir__, 'Flutter')
39+
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
40+
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
41+
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
42+
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
43+
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
44+
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
3645

37-
# Flutter Pods
38-
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
39-
if generated_xcode_build_settings.empty?
40-
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
41-
end
42-
generated_xcode_build_settings.map { |p|
43-
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
44-
symlink = File.join('.symlinks', 'flutter')
45-
File.symlink(File.dirname(p[:path]), symlink)
46-
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
46+
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
47+
unless File.exist?(generated_xcode_build_settings_path)
48+
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
49+
end
50+
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
51+
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
52+
53+
unless File.exist?(copied_framework_path)
54+
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
4755
end
48-
}
56+
unless File.exist?(copied_podspec_path)
57+
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
58+
end
59+
end
60+
61+
# Keep pod path relative so it can be checked into Podfile.lock.
62+
pod 'Flutter', :path => 'Flutter'
4963

5064
# Plugin Pods
65+
66+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
67+
# referring to absolute paths on developers' machines.
68+
system('rm -rf .symlinks')
69+
system('mkdir -p .symlinks/plugins')
5170
plugin_pods = parse_KV_file('../.flutter-plugins')
52-
plugin_pods.map { |p|
53-
symlink = File.join('.symlinks', 'plugins', p[:name])
54-
File.symlink(p[:path], symlink)
55-
pod p[:name], :path => File.join(symlink, 'ios')
56-
}
71+
plugin_pods.each do |name, path|
72+
symlink = File.join('.symlinks', 'plugins', name)
73+
File.symlink(path, symlink)
74+
pod name, :path => File.join(symlink, 'ios')
75+
end
5776
end
5877

78+
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
79+
install! 'cocoapods', :disable_input_output_paths => true
80+
5981
post_install do |installer|
6082
installer.pods_project.targets.each do |target|
6183
target.build_configurations.each do |config|
62-
config.build_settings['SWIFT_VERSION'] = '4.2'
6384
config.build_settings['ENABLE_BITCODE'] = 'NO'
6485
end
6586
end

example/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ PODS:
44
- Flutter
55
- path_provider (0.0.1):
66
- Flutter
7-
- permission_handler (3.2.0):
7+
- permission_handler (4.1.0):
88
- Flutter
99

1010
DEPENDENCIES:
11-
- Flutter (from `.symlinks/flutter/ios`)
11+
- Flutter (from `Flutter`)
1212
- flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`)
1313
- path_provider (from `.symlinks/plugins/path_provider/ios`)
1414
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
1515

1616
EXTERNAL SOURCES:
1717
Flutter:
18-
:path: ".symlinks/flutter/ios"
18+
:path: Flutter
1919
flutter_downloader:
2020
:path: ".symlinks/plugins/flutter_downloader/ios"
2121
path_provider:
@@ -26,9 +26,9 @@ EXTERNAL SOURCES:
2626
SPEC CHECKSUMS:
2727
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
2828
flutter_downloader: 058b9c41564a90500f67f3e432e3524613a7fd83
29-
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
30-
permission_handler: d4838243e7d0f4b18911a6422d81e7e6b71ad545
29+
path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
30+
permission_handler: b41310bab60fffbf8b5732cd9b4f565671d14762
3131

32-
PODFILE CHECKSUM: 1b9df8d859f07d47cc6f43477c116e72a973c68f
32+
PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271
3333

3434
COCOAPODS: 1.8.3

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
2222
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
2323
C4211353214285FA00A246B2 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C4D3DF9B2139330700C8D767 /* libsqlite3.tbd */; };
24-
E147D2C1EF81ADC30B23A16D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F01544EE452922100CC9EA /* Pods_Runner.framework */; };
24+
CF50C2DF24CEBF4D59364426 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 906E8221776F938CCDE0D185 /* libPods-Runner.a */; };
2525
/* End PBXBuildFile section */
2626

2727
/* Begin PBXCopyFilesBuildPhase section */
@@ -49,6 +49,7 @@
4949
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
5050
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5151
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
52+
906E8221776F938CCDE0D185 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5253
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5354
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
5455
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
@@ -59,7 +60,6 @@
5960
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6061
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6162
C4D3DF9B2139330700C8D767 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
62-
F3F01544EE452922100CC9EA /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6363
/* End PBXFileReference section */
6464

6565
/* Begin PBXFrameworksBuildPhase section */
@@ -70,7 +70,7 @@
7070
C4211353214285FA00A246B2 /* libsqlite3.tbd in Frameworks */,
7171
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
7272
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
73-
E147D2C1EF81ADC30B23A16D /* Pods_Runner.framework in Frameworks */,
73+
CF50C2DF24CEBF4D59364426 /* libPods-Runner.a in Frameworks */,
7474
);
7575
runOnlyForDeploymentPostprocessing = 0;
7676
};
@@ -146,7 +146,7 @@
146146
isa = PBXGroup;
147147
children = (
148148
C4D3DF9B2139330700C8D767 /* libsqlite3.tbd */,
149-
F3F01544EE452922100CC9EA /* Pods_Runner.framework */,
149+
906E8221776F938CCDE0D185 /* libPods-Runner.a */,
150150
);
151151
name = Frameworks;
152152
sourceTree = "<group>";
@@ -166,6 +166,7 @@
166166
9705A1C41CF9048500538489 /* Embed Frameworks */,
167167
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
168168
1124B0CEA6CAA939D404E302 /* [CP] Embed Pods Frameworks */,
169+
FA8C91C0D4E3D37518FAA6FB /* [CP] Copy Pods Resources */,
169170
);
170171
buildRules = (
171172
);
@@ -256,16 +257,9 @@
256257
files = (
257258
);
258259
inputPaths = (
259-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
260-
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
261-
"${BUILT_PRODUCTS_DIR}/flutter_downloader/flutter_downloader.framework",
262-
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
263260
);
264261
name = "[CP] Embed Pods Frameworks";
265262
outputPaths = (
266-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
267-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_downloader.framework",
268-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
269263
);
270264
runOnlyForDeploymentPostprocessing = 0;
271265
shellPath = /bin/sh;
@@ -300,6 +294,21 @@
300294
shellPath = /bin/sh;
301295
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
302296
};
297+
FA8C91C0D4E3D37518FAA6FB /* [CP] Copy Pods Resources */ = {
298+
isa = PBXShellScriptBuildPhase;
299+
buildActionMask = 2147483647;
300+
files = (
301+
);
302+
inputPaths = (
303+
);
304+
name = "[CP] Copy Pods Resources";
305+
outputPaths = (
306+
);
307+
runOnlyForDeploymentPostprocessing = 0;
308+
shellPath = /bin/sh;
309+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
310+
showEnvVarsInLog = 0;
311+
};
303312
/* End PBXShellScriptBuildPhase section */
304313

305314
/* Begin PBXSourcesBuildPhase section */

0 commit comments

Comments
 (0)