diff --git a/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTask.kt b/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTask.kt index 84c225dabf2d90..751c9269722b9f 100644 --- a/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTask.kt +++ b/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTask.kt @@ -142,18 +142,17 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() { } } - return CPP_TEMPLATE.replace("{{ rncliCppIncludes }}", cppIncludes) - .replace("{{ rncliCppTurboModuleJavaProviders }}", cppTurboModuleJavaProviders) - .replace("{{ rncliCppTurboModuleCxxProviders }}", cppTurboModuleCxxProviders) - .replace("{{ rncliCppComponentDescriptors }}", cppComponentDescriptors) + return CPP_TEMPLATE.replace("{{ autolinkingCppIncludes }}", cppIncludes) + .replace("{{ autolinkingCppTurboModuleJavaProviders }}", cppTurboModuleJavaProviders) + .replace("{{ autolinkingCppTurboModuleCxxProviders }}", cppTurboModuleCxxProviders) + .replace("{{ autolinkingCppComponentDescriptors }}", cppComponentDescriptors) } companion object { const val CMAKE_FILENAME = "Android-autolinking.cmake" - // This needs to be changed to not be `rncli.h`, but requires change to CMake pipeline - const val H_FILENAME = "rncli.h" - const val CPP_FILENAME = "rncli.cpp" + const val H_FILENAME = "autolinking.h" + const val CPP_FILENAME = "autolinking.cpp" const val CODEGEN_LIB_PREFIX = "react_codegen_" @@ -186,24 +185,24 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() { * */ - #include "rncli.h" - {{ rncliCppIncludes }} + #include "autolinking.h" + {{ autolinkingCppIncludes }} namespace facebook { namespace react { - std::shared_ptr rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) { - {{ rncliCppTurboModuleJavaProviders }} + std::shared_ptr autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) { + {{ autolinkingCppTurboModuleJavaProviders }} return nullptr; } - std::shared_ptr rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker) { - {{ rncliCppTurboModuleCxxProviders }} + std::shared_ptr autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker) { + {{ autolinkingCppTurboModuleCxxProviders }} return nullptr; } - void rncli_registerProviders(std::shared_ptr providerRegistry) { - {{ rncliCppComponentDescriptors }} + void autolinking_registerProviders(std::shared_ptr providerRegistry) { + {{ autolinkingCppComponentDescriptors }} return; } @@ -234,9 +233,9 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() { namespace facebook { namespace react { - std::shared_ptr rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms); - std::shared_ptr rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker); - void rncli_registerProviders(std::shared_ptr providerRegistry); + std::shared_ptr autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms); + std::shared_ptr autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker); + void autolinking_registerProviders(std::shared_ptr providerRegistry); } // namespace react } // namespace facebook diff --git a/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTaskTest.kt b/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTaskTest.kt index b014b69a151fcc..84cd34e98419f1 100644 --- a/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTaskTest.kt +++ b/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTaskTest.kt @@ -165,23 +165,23 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest { * */ - #include "rncli.h" + #include "autolinking.h" namespace facebook { namespace react { - std::shared_ptr rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) { + std::shared_ptr autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) { return nullptr; } - std::shared_ptr rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker) { + std::shared_ptr autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker) { return nullptr; } - void rncli_registerProviders(std::shared_ptr providerRegistry) { + void autolinking_registerProviders(std::shared_ptr providerRegistry) { return; } @@ -209,14 +209,14 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest { * */ - #include "rncli.h" + #include "autolinking.h" #include #include namespace facebook { namespace react { - std::shared_ptr rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) { + std::shared_ptr autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) { auto module_aPackage = aPackage_ModuleProvider(moduleName, params); if (module_aPackage != nullptr) { return module_aPackage; @@ -228,12 +228,12 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest { return nullptr; } - std::shared_ptr rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker) { + std::shared_ptr autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr& jsInvoker) { return nullptr; } - void rncli_registerProviders(std::shared_ptr providerRegistry) { + void autolinking_registerProviders(std::shared_ptr providerRegistry) { return; } diff --git a/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp b/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp index e6659fe53a8e6b..db2e6c199e4de8 100644 --- a/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp +++ b/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp @@ -29,9 +29,9 @@ #include #include +#include #include #include -#include #include #ifdef REACT_NATIVE_APP_CODEGEN_HEADER @@ -56,8 +56,8 @@ void registerComponents( REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry); #endif - // And we fallback to the components autolinked by RN CLI - rncli_registerProviders(registry); + // And we fallback to the components autolinked + autolinking_registerProviders(registry); } std::shared_ptr cxxModuleProvider( @@ -71,8 +71,8 @@ std::shared_ptr cxxModuleProvider( // return std::make_shared(jsInvoker); // } - // And we fallback to the CXX module providers autolinked by RN CLI - return rncli_cxxModuleProvider(name, jsInvoker); + // And we fallback to the CXX module providers autolinked + return autolinking_cxxModuleProvider(name, jsInvoker); } std::shared_ptr javaModuleProvider( @@ -101,8 +101,8 @@ std::shared_ptr javaModuleProvider( return module; } - // And we fallback to the module providers autolinked by RN CLI - if (auto module = rncli_ModuleProvider(name, params)) { + // And we fallback to the module providers autolinked + if (auto module = autolinking_ModuleProvider(name, params)) { return module; }