From 86e80caac00a277793916cb7d050233b16c2017b Mon Sep 17 00:00:00 2001 From: Alberto Cabrera Date: Fri, 12 Jan 2024 13:42:00 +0800 Subject: [PATCH] update pod file --- ios/Podfile | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index c0d511e3e..84cb696fd 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -29,22 +29,26 @@ target 'MissionHub' do # you should disable these next few lines. use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' }) + ENVFILES = { + 'Release' => '$(PODS_ROOT)/../../.env.production', + } + post_install do |installer| flipper_post_install(installer) - installer.pods_project.targets.each do |target| - if target.name == 'react-native-config' # https://github.com/luggit/react-native-config/issues/357#issuecomment-508649128 - phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) - phase.shell_script = "cd ../../"\ - " && RNC_ROOT=./node_modules/react-native-config/"\ - " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\ - " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\ - " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby" + # installer.pods_project.targets.each do |target| + # if target.name == 'react-native-config' # https://github.com/luggit/react-native-config/issues/357#issuecomment-508649128 + # phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) + # phase.shell_script = "cd ../../"\ + # " && RNC_ROOT=./node_modules/react-native-config/"\ + # " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\ + # " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\ + # " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby" - target.build_phases << phase - target.build_phases.move(phase,0) - end - end + # target.build_phases << phase + # target.build_phases.move(phase,0) + # end + # end installer.pods_project.targets.each do |target| if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" @@ -53,5 +57,13 @@ target 'MissionHub' do end end end + + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + if target.name == 'react-native-config' + config.build_settings['ENVFILE'] = ENVFILES[config.name] + end + end + end end end