説明なし

Podfile 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. def ccache_enabled?(podfile_properties)
  6. # Environment variable takes precedence
  7. return ENV['USE_CCACHE'] == '1' if ENV['USE_CCACHE']
  8. # Fall back to Podfile properties
  9. podfile_properties['apple.ccacheEnabled'] == 'true'
  10. end
  11. ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false'
  12. ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
  13. ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
  14. ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
  15. platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
  16. prepare_react_native_project!
  17. target 'SmartFarmLite' do
  18. use_expo_modules!
  19. if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
  20. config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
  21. else
  22. config_command = [
  23. 'node',
  24. '--no-warnings',
  25. '--eval',
  26. 'require(\'expo/bin/autolinking\')',
  27. 'expo-modules-autolinking',
  28. 'react-native-config',
  29. '--json',
  30. '--platform',
  31. 'ios'
  32. ]
  33. end
  34. config = use_native_modules!(config_command)
  35. use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  36. use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
  37. use_react_native!(
  38. :path => config[:reactNativePath],
  39. :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
  40. # An absolute path to your application root.
  41. :app_path => "#{Pod::Config.instance.installation_root}/..",
  42. :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
  43. )
  44. post_install do |installer|
  45. react_native_post_install(
  46. installer,
  47. config[:reactNativePath],
  48. :mac_catalyst_enabled => false,
  49. :ccache_enabled => ccache_enabled?(podfile_properties),
  50. )
  51. end
  52. end