summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.h
diff options
context:
space:
mode:
authorAdam Koski <adamkoski@google.com>2017-07-21 10:55:27 -0700
committerAdam Koski <adamkoski@google.com>2017-10-20 16:25:18 -0700
commitdc21dea9b8b1157a4a9347b68301da4307c51168 (patch)
treee5a861fbec159776bebc37296753ca21c7916593 /tools/aapt2/java/JavaClassGenerator.h
parent0d769d80a9a871cd4f0e5dc24e63c86d97fb3ad8 (diff)
AAPT2: Produce Conditional Proguard Keep Rules
Add the option to produce keep rules that conditional keep based on usage of R identifiers. This allows Proguard to potentially shrink more code if resources are not used. Currently only produces conditional rules for classes referenced in layout resources because they are the most common and has the easiest transitive usage chain to analyze. Bug: 63628451 Test: make aapt2_tests and manual testing Change-Id: I6c1af7affd64af40c80e004d8506a9463444b2c3
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.h')
-rw-r--r--tools/aapt2/java/JavaClassGenerator.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator.h b/tools/aapt2/java/JavaClassGenerator.h
index 18746ffc5a0a..2541749750a6 100644
--- a/tools/aapt2/java/JavaClassGenerator.h
+++ b/tools/aapt2/java/JavaClassGenerator.h
@@ -24,6 +24,7 @@
#include "ResourceTable.h"
#include "ResourceValues.h"
+#include "androidfw/StringPiece.h"
#include "process/IResourceTableConsumer.h"
#include "process/SymbolTable.h"
@@ -78,6 +79,8 @@ class JavaClassGenerator {
const std::string& getError() const;
+ static std::string TransformToFieldName(const android::StringPiece& symbol);
+
private:
bool SkipSymbol(SymbolState state);
bool SkipSymbol(const Maybe<SymbolTable::Symbol>& symbol);