Skip to content

Commit 7658b62

Browse files
author
Veli Bacik
committed
pod file updated
1 parent de5895f commit 7658b62

File tree

3 files changed

+18
-130
lines changed

3 files changed

+18
-130
lines changed

ios/Podfile

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,78 +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!
3833

39-
# Flutter Pod
40-
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

8137
post_install do |installer|
8238
installer.pods_project.targets.each do |target|
83-
target.build_configurations.each do |config|
84-
config.build_settings['ENABLE_BITCODE'] = 'NO'
85-
end
39+
flutter_additional_ios_build_settings(target)
8640
end
8741
end

ios/Podfile.lock

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,24 @@ PODS:
77
- FMDB/standard (2.7.5)
88
- path_provider (0.0.1):
99
- Flutter
10-
- path_provider_linux (0.0.1):
11-
- Flutter
12-
- path_provider_macos (0.0.1):
13-
- Flutter
14-
- path_provider_windows (0.0.1):
15-
- Flutter
1610
- share (0.0.1):
1711
- Flutter
1812
- shared_preferences (0.0.1):
1913
- Flutter
20-
- shared_preferences_linux (0.0.1):
21-
- Flutter
22-
- shared_preferences_macos (0.0.1):
23-
- Flutter
24-
- shared_preferences_web (0.0.1):
25-
- Flutter
26-
- shared_preferences_windows (0.0.1):
27-
- Flutter
2814
- sqflite (0.0.2):
2915
- Flutter
3016
- FMDB (>= 2.7.5)
3117
- url_launcher (0.0.1):
3218
- Flutter
33-
- url_launcher_linux (0.0.1):
34-
- Flutter
35-
- url_launcher_macos (0.0.1):
36-
- Flutter
37-
- url_launcher_web (0.0.1):
38-
- Flutter
39-
- url_launcher_windows (0.0.1):
40-
- Flutter
4119

4220
DEPENDENCIES:
4321
- device_info (from `.symlinks/plugins/device_info/ios`)
4422
- Flutter (from `Flutter`)
4523
- path_provider (from `.symlinks/plugins/path_provider/ios`)
46-
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
47-
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
48-
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
4924
- share (from `.symlinks/plugins/share/ios`)
5025
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
51-
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
52-
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
53-
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
54-
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
5526
- sqflite (from `.symlinks/plugins/sqflite/ios`)
5627
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
57-
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
58-
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
59-
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
60-
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
6128

6229
SPEC REPOS:
6330
trunk:
@@ -70,58 +37,25 @@ EXTERNAL SOURCES:
7037
:path: Flutter
7138
path_provider:
7239
:path: ".symlinks/plugins/path_provider/ios"
73-
path_provider_linux:
74-
:path: ".symlinks/plugins/path_provider_linux/ios"
75-
path_provider_macos:
76-
:path: ".symlinks/plugins/path_provider_macos/ios"
77-
path_provider_windows:
78-
:path: ".symlinks/plugins/path_provider_windows/ios"
7940
share:
8041
:path: ".symlinks/plugins/share/ios"
8142
shared_preferences:
8243
:path: ".symlinks/plugins/shared_preferences/ios"
83-
shared_preferences_linux:
84-
:path: ".symlinks/plugins/shared_preferences_linux/ios"
85-
shared_preferences_macos:
86-
:path: ".symlinks/plugins/shared_preferences_macos/ios"
87-
shared_preferences_web:
88-
:path: ".symlinks/plugins/shared_preferences_web/ios"
89-
shared_preferences_windows:
90-
:path: ".symlinks/plugins/shared_preferences_windows/ios"
9144
sqflite:
9245
:path: ".symlinks/plugins/sqflite/ios"
9346
url_launcher:
9447
:path: ".symlinks/plugins/url_launcher/ios"
95-
url_launcher_linux:
96-
:path: ".symlinks/plugins/url_launcher_linux/ios"
97-
url_launcher_macos:
98-
:path: ".symlinks/plugins/url_launcher_macos/ios"
99-
url_launcher_web:
100-
:path: ".symlinks/plugins/url_launcher_web/ios"
101-
url_launcher_windows:
102-
:path: ".symlinks/plugins/url_launcher_windows/ios"
10348

10449
SPEC CHECKSUMS:
10550
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
106-
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
51+
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
10752
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
10853
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
109-
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
110-
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
111-
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
11254
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
11355
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
114-
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
115-
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
116-
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
117-
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
11856
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
11957
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
120-
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
121-
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
122-
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
123-
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
12458

125-
PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a
59+
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
12660

12761
COCOAPODS: 1.10.0

ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)