Podfile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. source 'https://github.com/CocoaPods/Specs.git'
  2. # Uncomment this line to define a global platform for your project
  3. platform :ios, '12.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. target.build_configurations.each do |config|
  33. config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
  34. ### inappwebview 插件
  35. config.build_settings['SWIFT_VERSION'] = '5.0' # required by simple_permission
  36. config.build_settings['ENABLE_BITCODE'] = 'NO'
  37. ### permission_handler插件
  38. config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
  39. '$(inherited)',
  40. ## dart: PermissionGroup.calendar
  41. # 'PERMISSION_EVENTS=1',
  42. ## dart: PermissionGroup.reminders
  43. # 'PERMISSION_REMINDERS=1',
  44. ## dart: PermissionGroup.contacts
  45. # 'PERMISSION_CONTACTS=1',
  46. ## dart: PermissionGroup.camera
  47. 'PERMISSION_CAMERA=1',
  48. ## dart: PermissionGroup.microphone
  49. 'PERMISSION_MICROPHONE=1',
  50. ## dart: PermissionGroup.speech
  51. # 'PERMISSION_SPEECH_RECOGNIZER=1',
  52. ## dart: PermissionGroup.photos
  53. 'PERMISSION_PHOTOS=1',
  54. ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
  55. 'PERMISSION_LOCATION=1',
  56. ## dart: PermissionGroup.notification
  57. 'PERMISSION_NOTIFICATIONS=1',
  58. ## dart: PermissionGroup.mediaLibrary
  59. # 'PERMISSION_MEDIA_LIBRARY=1',
  60. ## dart: PermissionGroup.sensors
  61. # 'PERMISSION_SENSORS=1',
  62. ## dart: PermissionGroup.bluetooth
  63. # 'PERMISSION_BLUETOOTH=1',
  64. ## dart: PermissionGroup.appTrackingTransparency
  65. # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
  66. ## dart: PermissionGroup.criticalAlerts
  67. # 'PERMISSION_CRITICAL_ALERTS=1'
  68. ]
  69. end
  70. end
  71. end