Skip to content

Commit

Permalink
update pod file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Cabrera committed Jan 12, 2024
1 parent 4de6d4a commit 86e80ca
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

0 comments on commit 86e80ca

Please sign in to comment.