mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add @DoNotStrip annotations to root Pojos
Summary: To ensure these Pojos don't get dead code eliminated, this diff adds a DoNotStrip annotation to each Props pojo object. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D26041103 fbshipit-source-id: 02031f39f5fc5ef1bb9f11b729e68437bfe95452
This commit is contained in:
committed by
Facebook GitHub Bot
parent
19ef415895
commit
e08681cf79
Vendored
+5
-1
@@ -236,6 +236,10 @@ function serializePojo(pojo: Pojo, basePackageName: string): string {
|
||||
importSet.add($import);
|
||||
};
|
||||
|
||||
if (pojo.isRoot) {
|
||||
addImport('com.facebook.proguard.annotations.DoNotStrip');
|
||||
}
|
||||
|
||||
const indent = ' '.repeat(2);
|
||||
|
||||
const members = pojo.properties
|
||||
@@ -269,7 +273,7 @@ function serializePojo(pojo: Pojo, basePackageName: string): string {
|
||||
|
||||
package ${basePackageName}.${pojo.namespace};
|
||||
${imports === '' ? '' : `\n${imports}\n`}
|
||||
public class ${pojo.name} {
|
||||
${pojo.isRoot ? '@DoNotStrip\n' : ''}public class ${pojo.name} {
|
||||
${members}
|
||||
${getters}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user