Podfile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Uncomment this line to define a global platform for your project
  2. # platform :ios, '9.0'
  3. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
  4. ENV['COCOAPODS_DISABLE_STATS'] = 'true'
  5. def parse_KV_file(file,seperator='=')
  6. file_abs_path = File.expand_path(file)
  7. if !File.exists? file_abs_path
  8. return [];
  9. end
  10. pods_ary = []
  11. skip_line_start_symbols = ["#", "/"]
  12. File.foreach(file_abs_path) { |line|
  13. next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
  14. plugin = line.split(pattern=seperator)
  15. if plugin.length == 2
  16. podname = plugin[0].strip()
  17. path = plugin[1].strip()
  18. podpath = File.expand_path("#{path}", file_abs_path)
  19. pods_ary.push({:name => podname,:path=>podpath});
  20. else
  21. puts "Invalid plugin specification: #{line}"
  22. end
  23. }
  24. return pods_ary
  25. end
  26. target 'Runner' do
  27. # Flutter Pods
  28. generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig")
  29. if generated_xcode_build_settings.empty?
  30. puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first."
  31. end
  32. generated_xcode_build_settings.map{ |p|
  33. if p[:name]=='FLUTTER_FRAMEWORK_DIR'
  34. pod 'Flutter', :path => p[:path]
  35. end
  36. }
  37. # Plugin Pods
  38. plugin_pods = parse_KV_file("../.flutter-plugins")
  39. plugin_pods.map{ |p|
  40. pod p[:name], :path => File.expand_path("ios",p[:path])
  41. }
  42. end
  43. post_install do |installer|
  44. installer.pods_project.targets.each do |target|
  45. target.build_configurations.each do |config|
  46. config.build_settings['ENABLE_BITCODE'] = 'NO'
  47. end
  48. end
  49. end