Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
gem 'concurrent-ruby', '<= 1.3.4'
2 changes: 1 addition & 1 deletion packages/helloworld/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
gem 'concurrent-ruby', '<= 1.3.4'
1 change: 1 addition & 0 deletions packages/helloworld/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ PLATFORMS
DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.1.0)
cocoapods (~> 1.13, != 1.15.1, != 1.15.0)
concurrent-ruby (<= 1.3.4)
xcodeproj (< 1.26.0)

RUBY VERSION
Expand Down
4 changes: 4 additions & 0 deletions packages/react-native/scripts/cocoapods/codegen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def run_codegen!(
codegen_utils: CodegenUtils.new()
)

if ENV["RCT_SKIP_CODEGEN"] == "1"
return
end

codegen_utils.use_react_native_codegen_discovery!(
disable_codegen,
app_path,
Expand Down
4 changes: 4 additions & 0 deletions packages/react-native/scripts/cocoapods/codegen_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def self.cleanup_done
end

def self.clean_up_build_folder(rn_path, codegen_dir, dir_manager: Dir, file_manager: File)
if ENV["RCT_SKIP_CODEGEN"] == "1"
return
end

return if CodegenUtils.cleanup_done()
CodegenUtils.set_cleanup_done(true)

Expand Down
25 changes: 24 additions & 1 deletion packages/react-native/scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def use_react_native! (
ENV['APP_PATH'] = app_path
ENV['REACT_NATIVE_PATH'] = path

# We set RCT_SKIP_CODEGEN to true, if the user wants to skip the running Codegen step from Cocoapods.
# This is needed as part of our migration away from cocoapods
ENV['RCT_SKIP_CODEGEN'] = ENV['RCT_SKIP_CODEGEN'] == '1' || ENV['RCT_IGNORE_PODS_DEPRECATION'] == '1' ? '1' : '0'

ReactNativePodsUtils.check_minimum_required_xcode()

# Current target definition is provided by Cocoapods and it refers to the target
Expand Down Expand Up @@ -363,6 +367,25 @@ def rct_cxx_language_standard()
return Helpers::Constants.cxx_language_standard
end

def print_cocoapods_deprecation_message()
if ENV["RCT_IGNORE_PODS_DEPRECATION"] == "1"
return
end

puts ''
puts '==================== DEPRECATION NOTICE ====================='.yellow
puts 'Calling `pod install` directly is deprecated in React Native'.yellow
puts 'because we are moving away from Cocoapods toward alternative'.yellow
puts 'solutions to build the project.'.yellow
puts '* If you are using Expo, please run:'.yellow
puts '`npx expo run:ios`'.yellow
puts '* If you are using the Community CLI, please run:'.yellow
puts '`yarn ios`'.yellow
puts '============================================================='.yellow
puts ''

end

# Function that executes after React Native has been installed to configure some flags and build settings.
#
# Parameters
Expand Down Expand Up @@ -412,6 +435,6 @@ def react_native_post_install(
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
NewArchitectureHelper.modify_flags_for_new_architecture(installer, NewArchitectureHelper.new_arch_enabled)


print_cocoapods_deprecation_message
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
end
2 changes: 1 addition & 1 deletion packages/rn-tester/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ gem 'cocoapods', '~> 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'rexml'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
gem 'concurrent-ruby', '<= 1.3.4'