Prevent getLegacyCxxModule from being stripped

Summary: `ReactPackageTurboModuleManagerDelegate.getLegacyCxxModule` isn't called from Java. Therefore, ProGuard will strip this method to reduce code size. To prevent this, we need to add the `DoNotStrip` annotation to this method. This annotation isn't necessary for the `getModule` method, since `getModule` is used in `TurboModuleManager.getJavaModule`.

Reviewed By: fkgozali

Differential Revision: D15996432

fbshipit-source-id: d34a7d28f7678e2dfc917f52d5cacc286bc33a0a
This commit is contained in:
Ramanpreet Nara
2019-06-26 10:05:33 -07:00
committed by Facebook Github Bot
parent 0a34fb78ab
commit 90897a9f62
2 changed files with 3 additions and 0 deletions
@@ -13,6 +13,7 @@ rn_android_library(
"PUBLIC",
],
deps = [
react_native_dep("java/com/facebook/proguard/annotations:annotations"),
react_native_dep("java/com/facebook/systrace:systrace"),
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
@@ -3,6 +3,7 @@
package com.facebook.react.turbomodule.core;
import com.facebook.infer.annotation.Assertions;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.ReactPackage;
import com.facebook.react.TurboReactPackage;
import com.facebook.react.bridge.CxxModuleWrapper;
@@ -32,6 +33,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate extends TurboModule
@Nullable
@Override
@DoNotStrip
public TurboModule getModule(String moduleName) {
TurboModule module = resolveModule(moduleName);
if (module == null) {