Нема описа

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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, separator='=')
  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=separator)
  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. # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  28. # referring to absolute paths on developers' machines.
  29. system('rm -rf .symlinks')
  30. system('mkdir -p .symlinks/plugins')
  31. # Flutter Pods
  32. generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  33. if generated_xcode_build_settings.empty?
  34. puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
  35. end
  36. generated_xcode_build_settings.map { |p|
  37. if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
  38. symlink = File.join('.symlinks', 'flutter')
  39. File.symlink(File.dirname(p[:path]), symlink)
  40. pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
  41. end
  42. }
  43. # Plugin Pods
  44. plugin_pods = parse_KV_file('../.flutter-plugins')
  45. plugin_pods.map { |p|
  46. symlink = File.join('.symlinks', 'plugins', p[:name])
  47. File.symlink(p[:path], symlink)
  48. pod p[:name], :path => File.join(symlink, 'ios')
  49. }
  50. end
  51. post_install do |installer|
  52. installer.pods_project.targets.each do |target|
  53. target.build_configurations.each do |config|
  54. config.build_settings['ENABLE_BITCODE'] = 'NO'
  55. end
  56. end
  57. end