Skip to content

Commit

Permalink
Fix Cocoapods for Xcode 14.3.0 (#36759)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #36759

On Thursday the 30th, Apple Released Xcode 14.3.0.
This Version of Xcode enforce some version checks for which React-Codegen, which supported iOS 11 as minimum supported version, could not be build anymore.

This change ensue that React-Codegen is always aligned to the min version supported by React Native.
Plus, it moves CircleCI's Xcode to 14.3.0, to keep this problem in Check.

While working on this, I figured that, with the monorepo, Ruby tests stopped working because they were in the wrong folder: I moved them in the right one.

## Changelog:
[iOS][Fixed] - Make React Native build with Xcode 14.3.0 and fix tests

Reviewed By: blakef

Differential Revision: D44605617

fbshipit-source-id: 3ec1f5b36858ef07d9f713d74eb411a1edcccd45
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Apr 2, 2023
1 parent a2d2696 commit cb88e75
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ references:
# Dependency Anchors
# -------------------------
dependency_versions:
xcode_version: &xcode_version "14.2.0"
xcode_version: &xcode_version "14.3.0"
nodelts_image: &nodelts_image "cimg/node:18.12.1"
nodeprevlts_image: &nodeprevlts_image "cimg/node:16.18.1"

Expand Down Expand Up @@ -620,7 +620,7 @@ jobs:
- run:
name: Run Ruby Tests
command: |
cd scripts
cd packages/react-native/scripts
sh run_ruby_tests.sh
- run_yarn
- *attach_hermes_workspace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
require_relative "./test_utils/CodegenScriptPhaseExtractorMock.rb"
require_relative "./test_utils/FileUtilsMock.rb"

# mocking the min_ios_version_supported function
# as it is not possible to require the original react_native_pod
# without incurring in circular deps
# TODO: move `min_ios_version_supported` to utils.rb
def min_ios_version_supported
return '12.4'
end

class CodegenUtilsTests < Test::Unit::TestCase
:base_path

Expand Down Expand Up @@ -527,7 +535,7 @@ def get_podspec_no_fabric_no_script
'source' => { :git => '' },
'header_mappings_dir' => './',
'platforms' => {
'ios' => '11.0',
'ios' => '12.4',
},
'source_files' => "**/*.{h,mm,cpp}",
'pod_target_xcconfig' => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/scripts/cocoapods/codegen_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa
'source' => { :git => '' },
'header_mappings_dir' => './',
'platforms' => {
'ios' => '11.0',
'ios' => min_ios_version_supported,
},
'source_files' => "**/*.{h,mm,cpp}",
'pod_target_xcconfig' => {
Expand Down
File renamed without changes.

0 comments on commit cb88e75

Please sign in to comment.