@@ -27,11 +27,38 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
27
27
28
28
flutter_ios_podfile_setup
29
29
30
+ def install_plugin_pods ( application_path = nil , relative_symlink_dir , platform )
31
+ # defined_in_file is set by CocoaPods and is a Pathname to the Podfile.
32
+ application_path ||= File . dirname ( defined_in_file . realpath ) if self . respond_to? ( :defined_in_file )
33
+ raise 'Could not find application path' unless application_path
34
+
35
+ # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
36
+ # referring to absolute paths on developers' machines.
37
+
38
+ symlink_dir = File . expand_path ( relative_symlink_dir , application_path )
39
+ system ( 'rm' , '-rf' , symlink_dir ) # Avoid the complication of dependencies like FileUtils.
40
+
41
+ symlink_plugins_dir = File . expand_path ( 'plugins' , symlink_dir )
42
+ system ( 'mkdir' , '-p' , symlink_plugins_dir )
43
+
44
+ plugins_file = File . join ( application_path , '..' , '.flutter-plugins-dependencies' )
45
+ plugin_pods = flutter_parse_plugins_file ( plugins_file , platform )
46
+ plugin_pods . each do |plugin_hash |
47
+ plugin_name = plugin_hash [ 'name' ]
48
+ plugin_path = plugin_hash [ 'path' ]
49
+ if ( plugin_name && plugin_path )
50
+ specPath = "#{ plugin_path } /#{ platform } /#{ plugin_name } .podspec"
51
+ pod plugin_name , :path => specPath
52
+ end
53
+ end
54
+ end
55
+
30
56
target 'Runner' do
31
57
use_frameworks!
32
58
use_modular_headers!
33
59
34
- flutter_install_all_ios_pods File . dirname ( File . realpath ( __FILE__ ) )
60
+ flutter_install_ios_engine_pod ( File . dirname ( File . realpath ( __FILE__ ) ) )
61
+ install_plugin_pods ( File . dirname ( File . realpath ( __FILE__ ) ) , '.symlinks' , 'ios' )
35
62
end
36
63
37
64
post_install do |installer |
0 commit comments