Podfile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
  2. require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
  3. require 'json'
  4. podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
  5. ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
  6. ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
  7. use_autolinking_method_symbol = ('use' + '_native' + '_modules!').to_sym
  8. origin_autolinking_method = self.method(use_autolinking_method_symbol)
  9. self.define_singleton_method(use_autolinking_method_symbol) do |*args|
  10. if ENV['EXPO_UNSTABLE_CORE_AUTOLINKING'] == '1'
  11. Pod::UI.puts('Using expo-modules-autolinking as core autolinking source'.green)
  12. config_command = [
  13. 'node',
  14. '--no-warnings',
  15. '--eval',
  16. 'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
  17. 'react-native-config',
  18. '--json',
  19. '--platform',
  20. 'ios'
  21. ]
  22. origin_autolinking_method.call(config_command)
  23. else
  24. origin_autolinking_method.call()
  25. end
  26. end
  27. platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4'
  28. install! 'cocoapods',
  29. :deterministic_uuids => false
  30. prepare_react_native_project!
  31. target 'Crazycharge' do
  32. use_expo_modules!
  33. config = use_native_modules!
  34. use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  35. use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
  36. use_react_native!(
  37. :path => config[:reactNativePath],
  38. :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
  39. # An absolute path to your application root.
  40. :app_path => "#{Pod::Config.instance.installation_root}/..",
  41. :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
  42. )
  43. post_install do |installer|
  44. react_native_post_install(
  45. installer,
  46. config[:reactNativePath],
  47. :mac_catalyst_enabled => false,
  48. :ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
  49. )
  50. # This is necessary for Xcode 14, because it signs resource bundles by default
  51. # when building for devices.
  52. installer.target_installation_results.pod_target_installation_results
  53. .each do |pod_name, target_installation_result|
  54. target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
  55. resource_bundle_target.build_configurations.each do |config|
  56. config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
  57. end
  58. end
  59. end
  60. end
  61. post_integrate do |installer|
  62. begin
  63. expo_patch_react_imports!(installer)
  64. rescue => e
  65. Pod::UI.warn e
  66. end
  67. end
  68. end