diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 32b70174756ff7..88bfea49fb5873 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -900,7 +900,7 @@ SPEC CHECKSUMS: RCTTypeSafety: c7a7f67ae5b1b986b78d817baa408fc984ab7c0c React: f64c9f6db5428717922a3292ba6a448615a2e143 React-callinvoker: c5d61e29df57793f0dc10ec2bc01c846f863e51f - React-Codegen: 5c20632d128f21b4b94d00d70690821a8ac5dbef + React-Codegen: 2256e335ccce7326eeca6d7a668e05c4de259289 React-Core: 22bc86b79dd931dbfb7fd2af91a35a98d41ceb64 React-CoreModules: a8e2bdc1ebbf8d440478456197abd58d1691f61a React-cxxreact: cfc1663dae1ea52b465bbf021ef7b1527c5dc80c diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 57605c24412af6..6ccb40f6129fd5 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -73,6 +73,7 @@ def use_react_native! (options={}) pod temp_podinfo['spec']['name'], :path => temp_podinfo['path'] if fabric_enabled + checkAndGenerateEmptyThirdPartyProvider!(prefix) pod 'React-Fabric', :path => "#{prefix}/ReactCommon" pod 'React-rncore', :path => "#{prefix}/ReactCommon" pod 'React-graphics', :path => "#{prefix}/ReactCommon/react/renderer/graphics" @@ -201,6 +202,36 @@ def react_native_post_install(installer) fix_library_search_paths(installer) end +# This is a temporary supporting function until we enable use_react_native_codegen_discovery by default. +def checkAndGenerateEmptyThirdPartyProvider!(react_native_path) + return if ENV['USE_CODEGEN_DISCOVERY'] == '1' + + relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) + output_dir = "#{relative_installation_root}/#{$CODEGEN_OUTPUT_DIR}" + + provider_h_path = "#{output_dir}/RCTThirdPartyFabricComponentsProvider.h" + provider_cpp_path ="#{output_dir}/RCTThirdPartyFabricComponentsProvider.cpp" + + if(!File.exist?(provider_h_path) || !File.exist?(provider_cpp_path)) + # Just use a temp empty schema list. + temp_schema_list_path = "#{output_dir}/tmpSchemaList.txt" + File.open(temp_schema_list_path, 'w') do |f| + f.write('[]') + f.fsync + end + + Pod::UI.puts '[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider' + Pod::Executable.execute_command( + 'node', + [ + "#{react_native_path}/scripts/generate-provider-cli.js", + "--platform", 'ios', + "--schemaListPath", temp_schema_list_path, + "--outputDir", "#{output_dir}" + ]) + File.delete(temp_schema_list_path) if File.exist?(temp_schema_list_path) + end +end def generate_temp_pod_spec_for_codegen!(fabric_enabled) relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) @@ -243,7 +274,8 @@ def generate_temp_pod_spec_for_codegen!(fabric_enabled) "\"$(PODS_ROOT)/boost\"", "\"$(PODS_ROOT)/RCT-Folly\"", "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"", - "\"$(PODS_ROOT)/Headers/Private/React-Fabric\"" + "\"$(PODS_ROOT)/Headers/Private/React-Fabric\"", + "\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"", ].join(' ') }, 'dependencies': {