Podfile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Set by expo-router. This enables Fabric-only features from react-native-screens
  2. ENV['RNS_GAMMA_ENABLED'] ||= '1'
  3. require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
  4. require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
  5. require 'json'
  6. podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
  7. def ccache_enabled?(podfile_properties)
  8. # Environment variable takes precedence
  9. return ENV['USE_CCACHE'] == '1' if ENV['USE_CCACHE']
  10. # Fall back to Podfile properties
  11. podfile_properties['apple.ccacheEnabled'] == 'true'
  12. end
  13. ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
  14. ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true'
  15. ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true'
  16. ENV['RCT_HERMES_V1_ENABLED'] ||= '1' if podfile_properties['expo.useHermesV1'] == 'true'
  17. platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
  18. prepare_react_native_project!
  19. target 'LoanAssistant' do
  20. use_expo_modules!
  21. if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
  22. config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
  23. else
  24. config_command = [
  25. 'node',
  26. '--no-warnings',
  27. '--eval',
  28. 'require(\'expo/bin/autolinking\')',
  29. 'expo-modules-autolinking',
  30. 'react-native-config',
  31. '--json',
  32. '--platform',
  33. 'ios'
  34. ]
  35. end
  36. config = use_native_modules!(config_command)
  37. use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  38. use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
  39. use_react_native!(
  40. :path => config[:reactNativePath],
  41. :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
  42. # An absolute path to your application root.
  43. :app_path => "#{Pod::Config.instance.installation_root}/..",
  44. :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
  45. )
  46. post_install do |installer|
  47. react_native_post_install(
  48. installer,
  49. config[:reactNativePath],
  50. :mac_catalyst_enabled => false,
  51. :ccache_enabled => ccache_enabled?(podfile_properties),
  52. )
  53. end
  54. end