智莺生活APP的阿里百川 Flutter 插件
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

74 Zeilen
2.4 KiB

  1. # Uncomment this line to define a global platform for your project
  2. # platform :ios, '9.0'
  3. source 'https://cdn.cocoapods.org/'
  4. source 'http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git'
  5. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
  6. ENV['COCOAPODS_DISABLE_STATS'] = 'true'
  7. project 'Runner', {
  8. 'Debug' => :debug,
  9. 'Profile' => :release,
  10. 'Release' => :release,
  11. }
  12. def parse_KV_file(file, separator='=')
  13. file_abs_path = File.expand_path(file)
  14. if !File.exists? file_abs_path
  15. return [];
  16. end
  17. pods_ary = []
  18. skip_line_start_symbols = ["#", "/"]
  19. File.foreach(file_abs_path) { |line|
  20. next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
  21. plugin = line.split(pattern=separator)
  22. if plugin.length == 2
  23. podname = plugin[0].strip()
  24. path = plugin[1].strip()
  25. podpath = File.expand_path("#{path}", file_abs_path)
  26. pods_ary.push({:name => podname, :path => podpath});
  27. else
  28. puts "Invalid plugin specification: #{line}"
  29. end
  30. }
  31. return pods_ary
  32. end
  33. target 'Runner' do
  34. # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  35. # referring to absolute paths on developers' machines.
  36. system('rm -rf .symlinks')
  37. system('mkdir -p .symlinks/plugins')
  38. # Flutter Pods
  39. generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  40. if generated_xcode_build_settings.empty?
  41. puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
  42. end
  43. generated_xcode_build_settings.map { |p|
  44. if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
  45. symlink = File.join('.symlinks', 'flutter')
  46. File.symlink(File.dirname(p[:path]), symlink)
  47. pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
  48. end
  49. }
  50. # Plugin Pods
  51. plugin_pods = parse_KV_file('../.flutter-plugins')
  52. plugin_pods.map { |p|
  53. symlink = File.join('.symlinks', 'plugins', p[:name])
  54. File.symlink(p[:path], symlink)
  55. pod p[:name], :path => File.join(symlink, 'ios')
  56. }
  57. end
  58. # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
  59. install! 'cocoapods', :disable_input_output_paths => true
  60. post_install do |installer|
  61. installer.pods_project.targets.each do |target|
  62. target.build_configurations.each do |config|
  63. config.build_settings['ENABLE_BITCODE'] = 'NO'
  64. end
  65. end
  66. end