You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
3.0 KiB
83 lines
3.0 KiB
# Uncomment this line to define a global platform for your project
|
|
platform :ios, '9.3'
|
|
|
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
|
|
|
def flutter_install_ios_plugin_pods(ios_application_path = nil)
|
|
# defined_in_file is set by CocoaPods and is a Pathname to the Podfile.
|
|
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
|
|
|
|
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
|
# referring to absolute paths on developers' machines.
|
|
|
|
symlink_dir = File.expand_path('.symlinks', ios_application_path)
|
|
system('rm', '-rf', symlink_dir) # Avoid the complication of dependencies like FileUtils.
|
|
|
|
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)
|
|
|
|
if plugin_name == 'flutter_ffmpeg'
|
|
pod 'flutter_ffmpeg/min-lts', :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
|
|
else
|
|
pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
project 'Runner', {
|
|
'Debug' => :debug,
|
|
'Profile' => :release,
|
|
'Release' => :release,
|
|
}
|
|
|
|
def flutter_root
|
|
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
|
|
unless File.exist?(generated_xcode_build_settings_path)
|
|
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
|
end
|
|
|
|
File.foreach(generated_xcode_build_settings_path) do |line|
|
|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
|
return matches[1].strip if matches
|
|
end
|
|
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
|
|
end
|
|
|
|
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
|
|
|
flutter_ios_podfile_setup
|
|
|
|
target 'Runner' do
|
|
use_frameworks!
|
|
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
|
$static_framework = ['flutter_txugcupload']
|
|
pre_install do |installer|
|
|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
|
|
installer.pod_targets.each do |pod|
|
|
if $static_framework.include?(pod.name)
|
|
def pod.build_type;
|
|
Pod::BuildType.static_library
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
post_install do |installer|
|
|
installer.pods_project.targets.each do |target|
|
|
flutter_additional_ios_build_settings(target)
|
|
end
|
|
end
|