summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.h
AgeCommit message (Collapse)Author
2021-02-24Use R field directly for shared lib styleable attrsRyan Mitchell
If a shared library exposes an attribute and a client uses the attribute in its own styleable, the value of the lib attribute resource id in the client styleable must be fixed with the correct package id at runtime. Since the client will not have an onResourcesLoaded to call, the client should directly reference the attribute resource field in its styleable. Bug: 147674078 Test: aapt2_tests Change-Id: I8e64bb2d3165a7072e2604fe1730b248545978f4
2017-12-18AAPT2: Propagate SPEC_OVERLAYABLE flag to final APKAdam Lesinski
Resources can be marked as overlayable, which means they can be overlaid by runtime resource overlays. This change propagates this state to the final resource table that is installed on device. Future work: - Have the idmap tool respect the overlayable state and ignore entries that overlay anything else. Bug: 64980941 Test: make aapt2_tests Change-Id: Id45b1e141a281be2ee32a4ac3096fcf1114d523b
2017-11-16AAPT2: Move all file output to FileOutputStreamAdam Lesinski
FileOutputStream is safe to use on Windows, as it opens files using our compatibility API. Bug: 68262818 Test: make aapt2_tests Change-Id: Ib0b27e93edd609b49b1327db7d9867a002198ebb
2017-10-20AAPT2: Produce Conditional Proguard Keep RulesAdam Koski
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
2017-04-11AAPT2: Generate R.txtAdam Lesinski
In order to support a staged rollout of support for AAPT2, libraries being built the old way (merged into a single resource directory) still need to make use of the generated R.txt AAPT emitted. Do the same as AAPT. Test: manual Change-Id: Iaac1e824ddbd67e4efbab7692cddc1e4aa052f5a
2017-02-22AAPT2: Few tweaks to get shared-libraries workingAdam Lesinski
Test: manual (building shared support library demo) Change-Id: I4730645aa92ba1893baf67ffe35fbd4aac0f8e46
2017-02-22AAPT2: Shared library supportAdam Lesinski
Test: make aapt2_tests Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
2017-01-17Move StringPiece to libandroidfwAdam Lesinski
libandroidfw needs to make use of StringPiece, so move it to libandroidfw and update all code referencing StringPiece in aapt2. Test: make libandroidfw_tests libaapt2_tests Change-Id: I68d7f0fc7c651b048d9d1f5e7971f10ef5349fa1
2016-10-26AAPT2: Rename to match new styleAdam Lesinski
Use Google3 naming style to match new projects' and open source google projects' style. Preferred to do this in a massive CL so as to avoid style inconsistencies that plague legacy code bases. This is a relatively NEW code base, may as well keep it up to date. Test: name/style refactor - existing tests pass Change-Id: Ie80ecb78d46ec53efdfca2336bb57d96cbb7fb87
2016-10-19Use Google3 style guide with .clang-formatAdam Lesinski
Test: style change only, builds ok Change-Id: I885180e24cb2e7b58cfb4967c3bcb40058ce4078
2016-07-13AAPT2: Remove usage of u16stringAdam Lesinski
For legacy reasons, we kept around the use of UTF-16 internally in AAPT2. We don't need this and this CL removes all instances of std::u16string and StringPiece16. The only places still needed are when interacting with the ResTable APIs that only operate in UTF16. Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
2016-04-04AAPT2: Add option to add JavaDoc annotations to Java classesAdam Lesinski
Change-Id: I7ee8c20cdd91380927a65c41097ffd3a6ffa2df5
2016-03-31AAPT2: Change how we generate Java classesAdam Lesinski
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
2016-03-11AAPT2: Add descriptions of Attributes in Styleables for R.javaAdam Lesinski
Change-Id: I69e7b73cbdfe4baf502348397435c501ae29ff5e
2015-11-06AAPT2: Fix inclusion of comments in R.java javadocAdam Lesinski
Comments weren't being copied when merged from the various resource tables. Also refactored the JavaClassGenerator to omit a class if no entries exist for it. Change-Id: I6eaa89b7b3715bc05403635a2baf0d1db3efd142
2015-10-30AAPT2: Support generating Manifest.javaAdam Lesinski
This includes comments from AndroidManifest.xml. Change-Id: I412d9ecb12bad20a49a683d6b3bea4a0be1235ae