Skip to content

Commit 4b6e69f

Browse files
committed
regenerate podfile
1 parent f3b9915 commit 4b6e69f

3 files changed

Lines changed: 35 additions & 108 deletions

File tree

ios/Podfile

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,82 +10,32 @@ project 'Runner', {
1010
'Release' => :release,
1111
}
1212

13-
def parse_KV_file(file, separator='=')
14-
file_abs_path = File.expand_path(file)
15-
if !File.exists? file_abs_path
16-
return [];
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
1717
end
18-
generated_key_values = {}
19-
skip_line_start_symbols = ["#", "/"]
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
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
3122
end
32-
generated_key_values
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
3324
end
3425

26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
3530
target 'Runner' do
3631
use_frameworks!
3732
use_modular_headers!
38-
39-
# Flutter Pod
4033

41-
copied_flutter_dir = File.join(__dir__, 'Flutter')
42-
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
43-
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
44-
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
45-
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
46-
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
47-
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
48-
49-
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
50-
unless File.exist?(generated_xcode_build_settings_path)
51-
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
52-
end
53-
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
54-
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
55-
56-
unless File.exist?(copied_framework_path)
57-
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
58-
end
59-
unless File.exist?(copied_podspec_path)
60-
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
61-
end
62-
end
63-
64-
# Keep pod path relative so it can be checked into Podfile.lock.
65-
pod 'Flutter', :path => 'Flutter'
66-
67-
# Plugin Pods
68-
69-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
70-
# referring to absolute paths on developers' machines.
71-
system('rm -rf .symlinks')
72-
system('mkdir -p .symlinks/plugins')
73-
plugin_pods = parse_KV_file('../.flutter-plugins')
74-
plugin_pods.each do |name, path|
75-
symlink = File.join('.symlinks', 'plugins', name)
76-
File.symlink(path, symlink)
77-
pod name, :path => File.join(symlink, 'ios')
78-
end
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
7935
end
8036

81-
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
82-
install! 'cocoapods', :disable_input_output_paths => true
83-
8437
post_install do |installer|
8538
installer.pods_project.targets.each do |target|
86-
target.build_configurations.each do |config|
87-
config.build_settings['SWIFT_VERSION'] = '5.0'
88-
config.build_settings['ENABLE_BITCODE'] = 'NO'
89-
end
39+
flutter_additional_ios_build_settings(target)
9040
end
9141
end

ios/Podfile.lock

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,21 @@ PODS:
1212
- Flutter
1313
- path_provider (0.0.1):
1414
- Flutter
15-
- path_provider_linux (0.0.1):
16-
- Flutter
17-
- path_provider_macos (0.0.1):
18-
- Flutter
19-
- path_provider_windows (0.0.1):
20-
- Flutter
2115
- sqflite (0.0.1):
2216
- Flutter
2317
- FMDB (~> 2.7.2)
2418
- Toast (4.0.0)
2519
- url_launcher (0.0.1):
2620
- Flutter
27-
- url_launcher_linux (0.0.1):
28-
- Flutter
29-
- url_launcher_macos (0.0.1):
30-
- Flutter
31-
- url_launcher_web (0.0.1):
32-
- Flutter
33-
- url_launcher_windows (0.0.1):
34-
- Flutter
3521

3622
DEPENDENCIES:
3723
- Flutter (from `Flutter`)
3824
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
3925
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
4026
- just_audio (from `.symlinks/plugins/just_audio/ios`)
4127
- path_provider (from `.symlinks/plugins/path_provider/ios`)
42-
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
43-
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
44-
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
4528
- sqflite (from `.symlinks/plugins/sqflite/ios`)
4629
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
47-
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
48-
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
49-
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
50-
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
5130

5231
SPEC REPOS:
5332
trunk:
@@ -65,24 +44,10 @@ EXTERNAL SOURCES:
6544
:path: ".symlinks/plugins/just_audio/ios"
6645
path_provider:
6746
:path: ".symlinks/plugins/path_provider/ios"
68-
path_provider_linux:
69-
:path: ".symlinks/plugins/path_provider_linux/ios"
70-
path_provider_macos:
71-
:path: ".symlinks/plugins/path_provider_macos/ios"
72-
path_provider_windows:
73-
:path: ".symlinks/plugins/path_provider_windows/ios"
7447
sqflite:
7548
:path: ".symlinks/plugins/sqflite/ios"
7649
url_launcher:
7750
:path: ".symlinks/plugins/url_launcher/ios"
78-
url_launcher_linux:
79-
:path: ".symlinks/plugins/url_launcher_linux/ios"
80-
url_launcher_macos:
81-
:path: ".symlinks/plugins/url_launcher_macos/ios"
82-
url_launcher_web:
83-
:path: ".symlinks/plugins/url_launcher_web/ios"
84-
url_launcher_windows:
85-
:path: ".symlinks/plugins/url_launcher_windows/ios"
8651

8752
SPEC CHECKSUMS:
8853
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
@@ -91,17 +56,10 @@ SPEC CHECKSUMS:
9156
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
9257
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
9358
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
94-
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
95-
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
96-
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
9759
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
9860
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
9961
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
100-
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
101-
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
102-
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
103-
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
10462

105-
PODFILE CHECKSUM: 14d97608efc2f2caa54eca41e40bda4974cdbbd6
63+
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
10664

10765
COCOAPODS: 1.9.3

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,28 @@
212212
files = (
213213
);
214214
inputPaths = (
215+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
216+
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
217+
"${PODS_ROOT}/../Flutter/Flutter.framework",
218+
"${BUILT_PRODUCTS_DIR}/Toast/Toast.framework",
219+
"${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework",
220+
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
221+
"${BUILT_PRODUCTS_DIR}/just_audio/just_audio.framework",
222+
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
223+
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
224+
"${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework",
215225
);
216226
name = "[CP] Embed Pods Frameworks";
217227
outputPaths = (
228+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
229+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
230+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast.framework",
231+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework",
232+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
233+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/just_audio.framework",
234+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
235+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
236+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework",
218237
);
219238
runOnlyForDeploymentPostprocessing = 0;
220239
shellPath = /bin/sh;

0 commit comments

Comments
 (0)