15589cdf3S猫头猫require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") 25589cdf3S猫头猫# Resolve react_native_pods.rb with node to allow for hoisting 35589cdf3S猫头猫require Pod::Executable.execute_command('node', ['-p', 45589cdf3S猫头猫 'require.resolve( 55589cdf3S猫头猫 "react-native/scripts/react_native_pods.rb", 65589cdf3S猫头猫 {paths: [process.argv[1]]}, 75589cdf3S猫头猫 )', __dir__]).strip 8bf6e62f2S猫头猫 95589cdf3S猫头猫platform :ios, min_ios_version_supported 105589cdf3S猫头猫prepare_react_native_project! 115589cdf3S猫头猫 125589cdf3S猫头猫linkage = ENV['USE_FRAMEWORKS'] 135589cdf3S猫头猫if linkage != nil 145589cdf3S猫头猫 Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 155589cdf3S猫头猫 use_frameworks! :linkage => linkage.to_sym 165589cdf3S猫头猫end 17bf6e62f2S猫头猫 18bf6e62f2S猫头猫target 'MusicFree' do 195589cdf3S猫头猫 use_expo_modules! 205589cdf3S猫头猫 post_integrate do |installer| 215589cdf3S猫头猫 begin 225589cdf3S猫头猫 expo_patch_react_imports!(installer) 235589cdf3S猫头猫 rescue => e 245589cdf3S猫头猫 Pod::UI.warn e 255589cdf3S猫头猫 end 265589cdf3S猫头猫 end 27*6613e772Smaotoumao if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1' 28*6613e772Smaotoumao config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"]; 29*6613e772Smaotoumao else 30*6613e772Smaotoumao config_command = [ 31*6613e772Smaotoumao 'node', 32*6613e772Smaotoumao '--no-warnings', 33*6613e772Smaotoumao '--eval', 34*6613e772Smaotoumao 'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))', 35*6613e772Smaotoumao 'react-native-config', 36*6613e772Smaotoumao '--json', 37*6613e772Smaotoumao '--platform', 38*6613e772Smaotoumao 'ios' 39*6613e772Smaotoumao ] 40*6613e772Smaotoumao end 41*6613e772Smaotoumao 42*6613e772Smaotoumao config = use_native_modules!(config_command) 43bf6e62f2S猫头猫 44bf6e62f2S猫头猫 use_react_native!( 45bf6e62f2S猫头猫 :path => config[:reactNativePath], 46bf6e62f2S猫头猫 # An absolute path to your application root. 47bf6e62f2S猫头猫 :app_path => "#{Pod::Config.instance.installation_root}/.." 48bf6e62f2S猫头猫 ) 49bf6e62f2S猫头猫 50bf6e62f2S猫头猫 target 'MusicFreeTests' do 51bf6e62f2S猫头猫 inherit! :complete 52bf6e62f2S猫头猫 # Pods for testing 53bf6e62f2S猫头猫 end 54bf6e62f2S猫头猫 55bf6e62f2S猫头猫 post_install do |installer| 565589cdf3S猫头猫 # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 575589cdf3S猫头猫 react_native_post_install( 585589cdf3S猫头猫 installer, 595589cdf3S猫头猫 config[:reactNativePath], 605589cdf3S猫头猫 :mac_catalyst_enabled => false, 615589cdf3S猫头猫 # :ccache_enabled => true 625589cdf3S猫头猫 ) 63bf6e62f2S猫头猫 end 64bf6e62f2S猫头猫end 65