OSDN Git Service

AAPT2: Change how we generate Java classes
authorAdam Lesinski <adamlesinski@google.com>
Thu, 31 Mar 2016 20:33:02 +0000 (13:33 -0700)
committerAdam Lesinski <adamlesinski@google.com>
Thu, 31 Mar 2016 23:43:04 +0000 (16:43 -0700)
commit6cbfb1de493e42d937158ed57495c9656864ccba
treecfc5c985a647ba2282904b028e20409d45b43635
parentbecc30196dbd6ebe68726c984a448c90fa6ef167
AAPT2: Change how we generate Java classes

Previously we would be writing out the Manifest.java file as we
processed the AndroidManifest.xml. This would lead to empty
Manifest classes if there were no permissions or permission groups
defined in the AndroidManifest.xml.

This would pose problems for processes that checked for public classes
and considered them part of the API (support lib).

Now we collect the structure of the Java class in memory before deciding
if a file should be created.

Change-Id: I6b909f28d74356414c6ef5ad005180d6ea5e44ca
12 files changed:
tools/aapt2/Android.mk
tools/aapt2/java/AnnotationProcessor.cpp
tools/aapt2/java/AnnotationProcessor.h
tools/aapt2/java/ClassDefinition.cpp [new file with mode: 0644]
tools/aapt2/java/ClassDefinition.h [new file with mode: 0644]
tools/aapt2/java/ClassDefinitionWriter.h [deleted file]
tools/aapt2/java/JavaClassGenerator.cpp
tools/aapt2/java/JavaClassGenerator.h
tools/aapt2/java/ManifestClassGenerator.cpp
tools/aapt2/java/ManifestClassGenerator.h
tools/aapt2/java/ManifestClassGenerator_test.cpp
tools/aapt2/link/Link.cpp