Add @DoNotStrip annotation to getConstants()

Summary:
NativeModule getConstants() methods on Java might not be used within Java. So, they can be stripped by proguard. This diff adds the DoNotStrip annotation to the getConstants() method.

Changelog: [Internal]

Reviewed By: keoskate

Differential Revision: D26265874

fbshipit-source-id: b405ee32406e829212e5c9641750a6b5795899c3
This commit is contained in:
Ramanpreet Nara
2021-02-05 11:48:30 -08:00
committed by Facebook GitHub Bot
parent b474be6cc8
commit cba6aba2e6
2 changed files with 2 additions and 0 deletions
@@ -339,6 +339,7 @@ function buildGetConstantsMethod(
return ` protected abstract Map<String, Object> getTypedExportedConstants();
@Override
@DoNotStrip
public final @Nullable Map<String, Object> getConstants() {
Map<String, Object> constants = getTypedExportedConstants();
if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {