Unverified Commit 0efc06ca authored by xster's avatar xster Committed by GitHub

Disable cocoapods stats in Podfile template (#13945)

parent 521bdaea
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.0' # platform :ios, '9.0'
if ENV['FLUTTER_FRAMEWORK_DIR'] == nil # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework') ENV['COCOAPODS_DISABLE_STATS'] = 'true'
end
target 'Runner' do
use_frameworks!
# Pods for Runner
# Flutter Pods def parse_KV_file(file,seperator='=')
pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR'] file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
if File.exists? '../.flutter-plugins' return [];
flutter_root = File.expand_path('..') end
File.foreach('../.flutter-plugins') { |line| pods_ary = []
plugin = line.split(pattern='=') skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=seperator)
if plugin.length == 2 if plugin.length == 2
name = plugin[0].strip() podname = plugin[0].strip()
path = plugin[1].strip() path = plugin[1].strip()
resolved_path = File.expand_path("#{path}/ios", flutter_root) podpath = File.expand_path("#{path}", file_abs_path)
pod name, :path => resolved_path pods_ary.push({:name => podname,:path=>podpath});
else else
puts "Invalid plugin specification: #{line}" puts "Invalid plugin specification: #{line}"
end end
} }
return pods_ary
end
target 'Runner' do
# 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."
end
generated_xcode_build_settings.map{ |p|
if p[:name]=='FLUTTER_FRAMEWORK_DIR'
pod 'Flutter', :path => p[:path]
end end
}
# Plugin Pods
plugin_pods = parse_KV_file("../.flutter-plugins")
plugin_pods.map{ |p|
pod p[:name], :path => File.expand_path("ios",p[:path])
}
end end
post_install do |installer| post_install do |installer|
......
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.0' # platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
def parse_KV_file(file,seperator='=') def parse_KV_file(file,seperator='=')
file_abs_path = File.expand_path(file) file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path if !File.exists? file_abs_path
......
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.0' # platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
def parse_KV_file(file,seperator='=') def parse_KV_file(file,seperator='=')
file_abs_path = File.expand_path(file) file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path if !File.exists? file_abs_path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment