Podfile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. platform :osx, '10.11'
  2. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
  3. ENV['COCOAPODS_DISABLE_STATS'] = 'true'
  4. project 'Runner', {
  5. 'Debug' => :debug,
  6. 'Profile' => :release,
  7. 'Release' => :release,
  8. }
  9. def flutter_root
  10. generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
  11. unless File.exist?(generated_xcode_build_settings_path)
  12. raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
  13. end
  14. File.foreach(generated_xcode_build_settings_path) do |line|
  15. matches = line.match(/FLUTTER_ROOT\=(.*)/)
  16. return matches[1].strip if matches
  17. end
  18. raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
  19. end
  20. require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
  21. flutter_macos_podfile_setup
  22. def build_specify_archs_only
  23. if ENV.has_key?('BUILD_ARCHS')
  24. xcodeproj_path = File.dirname(__FILE__) + '/Runner.xcodeproj'
  25. project = Xcodeproj::Project.open(xcodeproj_path)
  26. project.targets.each do |target|
  27. if target.name == 'Runner'
  28. target.build_configurations.each do |config|
  29. config.build_settings['ARCHS'] = ENV['BUILD_ARCHS']
  30. end
  31. end
  32. end
  33. project.save()
  34. end
  35. end
  36. build_specify_archs_only()
  37. target 'Runner' do
  38. use_frameworks!
  39. use_modular_headers!
  40. flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
  41. end
  42. post_install do |installer|
  43. installer.pods_project.targets.each do |target|
  44. flutter_additional_macos_build_settings(target)
  45. end
  46. end