packages/flutter_tools/bin/podhelper.rb
# Install iOS Flutter plugin pods.
#
# @example
#   target 'Runner' do
#     flutter_install_ios_plugin_pods
#   end
# @param [String] ios_application_path Path of the iOS directory of the Flutter app.
#                                      Optional, defaults to the Podfile directory.
Install iOS Flutter plugin pods.
Install iOS Flutter plugin pods .
def flutter_install_ios_plugin_pods(ios_application_path = nil)
  ios_application_path ||= File.dirname(defined_in_file.realpath) if self.respond_to?(:defined_in_file)
  raise 'Could not find iOS application path' unless ios_application_path
  symlink_dir = File.expand_path('.symlinks', ios_application_path)
  system('rm', '-rf', symlink_dir) 
  symlink_plugins_dir = File.expand_path('plugins', symlink_dir)
  system('mkdir', '-p', symlink_plugins_dir)
  plugins_file = File.join(ios_application_path, '..', '.flutter-plugins-dependencies')
  plugin_pods = flutter_parse_plugins_file(plugins_file)
  plugin_pods.each do |plugin_hash|
    plugin_name = plugin_hash['name']
    plugin_path = plugin_hash['path']
    if (plugin_name && plugin_path)
      symlink = File.join(symlink_plugins_dir, plugin_name)
      File.symlink(plugin_path, symlink)
      pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
    end
  end
end
def flutter_install_ios_plugin_pods ( ios_application_path = nil ) ios_application_path ||= File . dirname ( defined_in_file . realpath ) if self . respond_to? ( :defined_in_file ) raise 'Could not find iOS application path' unless ios_application_path symlink_dir = File . expand_path ( '.symlinks' , ios_application_path ) system ( 'rm' , '-rf' , symlink_dir ) symlink_plugins_dir = File . expand_path ( 'plugins' , symlink_dir ) system ( 'mkdir' , '-p' , symlink_plugins_dir ) plugins_file = File . join ( ios_application_path , '..' , '.flutter-plugins-dependencies' ) plugin_pods = flutter_parse_plugins_file ( plugins_file ) plugin_pods . each do | plugin_hash | plugin_name = plugin_hash [ 'name' ] plugin_path = plugin_hash [ 'path' ] if ( plugin_name && plugin_path ) symlink = File . join ( symlink_plugins_dir , plugin_name ) File . symlink ( plugin_path , symlink ) pod plugin_name , :path => File . join ( '.symlinks' , 'plugins' , plugin_name , 'ios' ) end end end
Install iOS Flutter plugin pods.
Install iOS Flutter plugin pods .
# defined_in_file is set by CocoaPods and is a Pathname to the Podfile. # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock # referring to absolute paths on developers' machines. # Avoid the complication of dependencies like FileUtils. # Keep pod path relative so it can be checked into Podfile.lock.
ios_application_path
ios_application_path Path of the iOS directory of the Flutter app. Optional, defaults to the Podfile directory.
ios_application_path Path of the iOS directory of the Flutter app . Optional defaults to the Podfile directory .
the Podfile directory
example
target 'Runner' do flutter_install_ios_plugin_pods end
target ' Runner ' do flutter_install_ios_plugin_pods end