diff --git a/Gemfile b/Gemfile index 4dd36df9782c..ba6ebadfc7d0 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/packages/helloworld/Gemfile b/packages/helloworld/Gemfile index 1036ed276bed..8dc184ef41c9 100644 --- a/packages/helloworld/Gemfile +++ b/packages/helloworld/Gemfile @@ -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' diff --git a/packages/helloworld/Gemfile.lock b/packages/helloworld/Gemfile.lock index 6f827425c2c3..dec3bd488504 100644 --- a/packages/helloworld/Gemfile.lock +++ b/packages/helloworld/Gemfile.lock @@ -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 diff --git a/packages/react-native/scripts/cocoapods/codegen.rb b/packages/react-native/scripts/cocoapods/codegen.rb index cd76a0a7540c..a19d151e17b7 100644 --- a/packages/react-native/scripts/cocoapods/codegen.rb +++ b/packages/react-native/scripts/cocoapods/codegen.rb @@ -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, diff --git a/packages/react-native/scripts/cocoapods/codegen_utils.rb b/packages/react-native/scripts/cocoapods/codegen_utils.rb index 6f62e8c75aed..3ce12e28ebc7 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -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) diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 5227eaa4e07e..4f1c53b0289e 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -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 @@ -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 @@ -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 diff --git a/packages/rn-tester/Gemfile b/packages/rn-tester/Gemfile index 120dcb2bf5d1..7161e74ee6a7 100644 --- a/packages/rn-tester/Gemfile +++ b/packages/rn-tester/Gemfile @@ -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'