Skip to content

Commit 45eabdb

Browse files
authored
fix(android): revert "always include ReactNative-application.cmake on 0.76" (#2341)
This reverts commit c1a56a7.
1 parent 0eaf227 commit 45eabdb

File tree

5 files changed

+2
-14
lines changed

5 files changed

+2
-14
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ android {
108108
resValue "string", "app_name", project.ext.react.appName
109109

110110
def cppStd = reactNativeVersion >= v(0, 74, 0) ? "-std=c++20" : "-std=c++17"
111-
if (reactNativeVersion >= v(0, 76, 0) || enableNewArchitecture) {
111+
if (enableNewArchitecture) {
112112
externalNativeBuild {
113113
cmake {
114114
arguments "-DANDROID_STL=c++_shared",

android/app/src/main/jni/AutolinkingCompat.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@
99
#define autolinking_cxxModuleProvider facebook::react::autolinking_cxxModuleProvider
1010
#define autolinking_registerProviders facebook::react::autolinking_registerProviders
1111

12-
#elif __has_include(<rncli.h>) // < 0.75
12+
#else // < 0.75
1313

1414
#include <rncli.h>
1515

1616
#define autolinking_ModuleProvider facebook::react::rncli_ModuleProvider
1717
#define autolinking_cxxModuleProvider facebook::react::rncli_cxxModuleProvider
1818
#define autolinking_registerProviders facebook::react::rncli_registerProviders
1919

20-
#else // Autolinking is handled elsewhere in the old architecture (paper)
21-
22-
#define REACTAPP_LEGACY_AUTOLINKING 1
23-
2420
#endif // __has_include(<autolinking.h>)
2521

2622
#endif // REACTAPP_JNI_AUTOLINKINGCOMPAT_H_

android/app/src/main/jni/ComponentsRegistry.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ void ComponentsRegistry::registerNatives()
3232

3333
facebook::react::DefaultComponentsRegistry::registerComponentDescriptorsFromEntryPoint =
3434
[](std::shared_ptr<ComponentDescriptorProviderRegistry const> registry) {
35-
#ifndef REACTAPP_LEGACY_AUTOLINKING
3635
// Register providers generated by `@react-native-community/cli`
3736
autolinking_registerProviders(registry);
38-
#endif // !REACTAPP_LEGACY_AUTOLINKING
3937
};
4038
}
4139

android/app/src/main/jni/OnLoad.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ using facebook::react::TurboModule;
1919

2020
namespace
2121
{
22-
#ifndef REACTAPP_LEGACY_AUTOLINKING
2322
std::shared_ptr<TurboModule> cxxModuleProvider(const std::string &name,
2423
const std::shared_ptr<CallInvoker> &jsInvoker)
2524
{
@@ -43,18 +42,15 @@ namespace
4342
// And we fallback to the module providers autolinked by RN CLI
4443
return autolinking_ModuleProvider(name, params);
4544
}
46-
#endif // !REACTAPP_LEGACY_AUTOLINKING
4745
} // namespace
4846

4947
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *)
5048
{
5149
return facebook::jni::initialize(vm, [] {
52-
#ifndef REACTAPP_LEGACY_AUTOLINKING
5350
DefaultTurboModuleManagerDelegate::cxxModuleProvider = &cxxModuleProvider;
5451
DefaultTurboModuleManagerDelegate::javaModuleProvider = &javaModuleProvider;
5552
DefaultComponentsRegistry::registerComponentDescriptorsFromEntryPoint =
5653
&autolinking_registerProviders;
57-
#endif // !REACTAPP_LEGACY_AUTOLINKING
5854
});
5955
}
6056

android/app/src/main/jni/TurboModuleManagerDelegate.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ std::shared_ptr<TurboModule> TurboModuleManagerDelegate::getTurboModule(StringRe
2828
std::shared_ptr<TurboModule> TurboModuleManagerDelegate::getTurboModule(
2929
StringRef name, const JavaTurboModule::InitParams &params)
3030
{
31-
#ifndef REACTAPP_LEGACY_AUTOLINKING
3231
// Try autolinked module providers first
3332
auto module = autolinking_ModuleProvider(name, params);
3433
if (module != nullptr) {
3534
return module;
3635
}
37-
#endif // !REACTAPP_LEGACY_AUTOLINKING
3836

3937
return rncore_ModuleProvider(name, params);
4038
}

0 commit comments

Comments
 (0)