A React Native app for the ultimate thinking partner.
at main 60 lines 2.4 kB view raw
1require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") 2require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods") 3 4require 'json' 5podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {} 6 7def ccache_enabled?(podfile_properties) 8 # Environment variable takes precedence 9 return ENV['USE_CCACHE'] == '1' if ENV['USE_CCACHE'] 10 11 # Fall back to Podfile properties 12 podfile_properties['apple.ccacheEnabled'] == 'true' 13end 14 15ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false' 16ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] 17ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false' 18ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false' 19platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1' 20 21prepare_react_native_project! 22 23target 'Co' do 24 use_expo_modules! 25 26 if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1' 27 config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"]; 28 else 29 config_command = [ 30 'npx', 31 'expo-modules-autolinking', 32 'react-native-config', 33 '--json', 34 '--platform', 35 'ios' 36 ] 37 end 38 39 config = use_native_modules!(config_command) 40 41 use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks'] 42 use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS'] 43 44 use_react_native!( 45 :path => config[:reactNativePath], 46 :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes', 47 # An absolute path to your application root. 48 :app_path => "#{Pod::Config.instance.installation_root}/..", 49 :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false', 50 ) 51 52 post_install do |installer| 53 react_native_post_install( 54 installer, 55 config[:reactNativePath], 56 :mac_catalyst_enabled => false, 57 :ccache_enabled => ccache_enabled?(podfile_properties), 58 ) 59 end 60end