Podfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Uncomment this line to define a global platform for your project
  2. # platform :ios, '9.0'
  3. platform :ios, '9.0'
  4. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
  5. ENV['COCOAPODS_DISABLE_STATS'] = 'true'
  6. project 'Runner', {
  7. 'Debug' => :debug,
  8. 'Profile' => :release,
  9. 'Release' => :release,
  10. }
  11. def flutter_root
  12. generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  13. unless File.exist?(generated_xcode_build_settings_path)
  14. raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  15. end
  16. File.foreach(generated_xcode_build_settings_path) do |line|
  17. matches = line.match(/FLUTTER_ROOT\=(.*)/)
  18. return matches[1].strip if matches
  19. end
  20. raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
  21. end
  22. require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
  23. flutter_ios_podfile_setup
  24. target 'Runner' do
  25. use_frameworks!
  26. use_modular_headers!
  27. flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  28. end
  29. post_install do |installer|
  30. installer.pods_project.targets.each do |target|
  31. flutter_additional_ios_build_settings(target)
  32. end
  33. end