2016-08-05 16:17:13 +00:00
|
|
|
# Uncomment this line to define a global platform for your project
|
|
|
|
# platform :ios, '9.0'
|
|
|
|
|
2017-12-27 15:30:31 +00:00
|
|
|
def parse_KV_file(file,seperator='=')
|
|
|
|
file_abs_path = File.expand_path(file)
|
|
|
|
if !File.exists? file_abs_path
|
|
|
|
return [];
|
|
|
|
end
|
|
|
|
pods_ary = []
|
2018-01-04 18:28:02 +00:00
|
|
|
skip_line_start_symbols = ["#", "/"]
|
2017-12-27 15:30:31 +00:00
|
|
|
File.foreach(file_abs_path) { |line|
|
2018-01-04 18:28:02 +00:00
|
|
|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
|
2017-12-27 15:30:31 +00:00
|
|
|
plugin = line.split(pattern=seperator)
|
2017-12-27 10:51:44 +00:00
|
|
|
if plugin.length == 2
|
2017-12-27 15:30:31 +00:00
|
|
|
podname = plugin[0].strip()
|
2017-12-27 10:51:44 +00:00
|
|
|
path = plugin[1].strip()
|
2017-12-27 15:30:31 +00:00
|
|
|
podpath = File.expand_path("#{path}", file_abs_path)
|
|
|
|
pods_ary.push({:name => podname,:path=>podpath});
|
2017-12-27 10:51:44 +00:00
|
|
|
else
|
|
|
|
puts "Invalid plugin specification: #{line}"
|
|
|
|
end
|
2017-12-27 15:30:31 +00:00
|
|
|
}
|
|
|
|
return pods_ary
|
|
|
|
end
|
|
|
|
|
|
|
|
target 'Runner' do
|
|
|
|
use_frameworks!
|
|
|
|
# Flutter Pods
|
|
|
|
generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig")
|
|
|
|
if generated_xcode_build_settings.empty?
|
|
|
|
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first."
|
2017-12-27 10:51:44 +00:00
|
|
|
end
|
2017-12-27 15:30:31 +00:00
|
|
|
generated_xcode_build_settings.map{ |p|
|
|
|
|
if p[:name]=='FLUTTER_FRAMEWORK_DIR'
|
|
|
|
pod 'Flutter', :path => p[:path]
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
# Plugin Pods
|
|
|
|
plugin_pods = parse_KV_file("../.flutter-plugins")
|
|
|
|
plugin_pods.map{ |p|
|
|
|
|
pod p[:name], :path => File.expand_path("ios",p[:path])
|
|
|
|
}
|
2017-03-23 13:59:12 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
post_install do |installer|
|
|
|
|
installer.pods_project.targets.each do |target|
|
|
|
|
target.build_configurations.each do |config|
|
|
|
|
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
|
|
|
end
|
|
|
|
end
|
2017-12-27 15:30:31 +00:00
|
|
|
end
|