History log of /frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1e4b0e54a3db31bdbcb9385bf22bab4b96096d1f 28-Apr-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Workaround for findViewById with package ID > 0x7f

The entire View code base checks IDs against View.NO_ID except
findViewById(), which checks to see if the ID is negative.

Any package ID > 0x7f is interpreted as a negative number in Java
(no unsigned ints), so this check prevents the use of IDs > 0x7f.

findViewById is final, so support library workarounds are not possible.

Instead, IDs (@id/foo) are just sentinels, their values don't matter.
If building for pre-O devices, rewrite any references to these IDs of
the for 0xPPTTEEEE, where PP > 7f, to 0x7fPPEEEE.

The symbol table will check for potential collisions against the base
APK, so this should be safe.

Bug: 37498913
Test: manual
Change-Id: Ife3bbd29db287757ef8a2ffd83053d97f1db2613
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
418763ff54170484c527bf618ef2fad34fe63f97 12-Apr-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Generate R.txt

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
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
b5dc4bd49a036e3403ca17e961d2c8e13e038295 23-Feb-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Few tweaks to get shared-libraries working

Test: manual (building shared support library demo)
Change-Id: I4730645aa92ba1893baf67ffe35fbd4aac0f8e46
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
ceb9b2f80f853059233cdd29057f39a5960a74ae 16-Feb-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Shared library support

Test: make aapt2_tests
Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
d5083f6f6b9bc76bbe64052bcec639eee752a321 17-Jan-2017 Adam Lesinski <adamlesinski@google.com> Move StringPiece to libandroidfw

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
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
ce5e56e243d262a9b65459c3bd0bb9eaadd40628 22-Oct-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Rename to match new style

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
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
d0f116b619feede0cfdb647157ce5ab4d50a1c46 09-Jul-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Remove usage of u16string

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
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
feaf99fa1b7563f15dbd4211718a6cfb7a3cc3c8 06-May-2016 Michael Wright <michaelwr@google.com> Stop emitting javadoc for @removed attributes.

We need the attributes to remain public because people might still be
linking against them, but we don't want them showing up in the
documentation any more. Them showing up in the documentation also had
the side effect that it would accidentally mark the parent class of
attributes as @removed, which was not intended.

Bug: 28663748

Change-Id: I2f6eb09455fddf1086e6b24bc3bea5292e8e32b7
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
626b3dbf74f02ae630ae0089632f5962340694dc 07-Apr-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Clean up R JavaDoc generation

- Don't generate private attributes in public R.java
- Strip out @SystemApi from comment when generating @android.annotation.SystemApi
- Only emit a single line (up to the first period) of an attribute's comment within
a styleable's attribute table.

Change-Id: Id6316a6861540325934133958939a12074ad4428
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
803c7c807969bea1f1c50f348832f5b60ad05d8e 07-Apr-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Enable windows build and make sure it builds

Mingw32 4.8 is kind of picky with macros and some complicated template
stuff. Luckily there was another way to represent the
SFINAE code that works on all platforms. Yay!

Change-Id: Idc2e38f47bfdc57b394550bfa0f53cc0b825df25
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
3524a23edb88f0e67352d55ac6a2919f1edf7b30 02-Apr-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Add option to add JavaDoc annotations to Java classes

Change-Id: I7ee8c20cdd91380927a65c41097ffd3a6ffa2df5
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
6cbfb1de493e42d937158ed57495c9656864ccba 31-Mar-2016 Adam Lesinski <adamlesinski@google.com> 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
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
7656554f91b40bc93bf94c89afcad4a9a8ced884 11-Mar-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Add descriptions of Attributes in Styleables for R.java

Change-Id: I69e7b73cbdfe4baf502348397435c501ae29ff5e
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
74605cd40256ca75b44cc3182eeeb886c92d737c 04-Mar-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Emit proper doclava comments in R.java

Bug:25958912
Change-Id: I663f2eb5bd54e3c3288ce9bc186c928f0a014f93
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
64587af8179affd38ee26543b748f2d63b7f67bb 19-Feb-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Support building, linking, and merging static libraries

Android static libraries are like APKs but they contain much more debugging
and source information. We need to treat them differently in 3 ways:

1) When building a static library, we skip things like ID assignment and
product/config stripping. Source information is emitted as well.
2) When building a static library and linking against another
static library, we don't want to merge, we want to simply reference.
3) When building an app that uses static libraries, we want to merge
the static library under the same package with or without mangling.

Bug:25958912
Change-Id: I425e032857936a3e83173c1edc2a6cdc6020b842
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
e4bb9eb5af5b0899dc0921d5580220b20e15bd5a 13-Feb-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Introduce notion of 'product' to ResourceTable

This allows us to preserve the various product definitions during the compile
phase, and allows us to select the product in the link phase.

This allows compiled files to remain product-independent, so that they do not need
to be recompiled when switching targets.

Bug:25958912
Change-Id: Iaa7eed25c834b67a39cdc9be43613e8b5ab6cdd7
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
b274e35abfbbd09e0fce983a215c11522c56cce2 07-Nov-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix inclusion of comments in R.java javadoc

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
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
3b4cd94034ff3e5567a2ba6da35d640ff61db4b9 31-Oct-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Add support for comments in R.java

Change-Id: Iaa5f3b75bf7de9dbf458fa5c452f7312989f4c4f
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp
ca5638fd85098c3d0a699492751043545f75553a 21-Oct-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Support generating Manifest.java

This includes comments from AndroidManifest.xml.

Change-Id: I412d9ecb12bad20a49a683d6b3bea4a0be1235ae
/frameworks/base/tools/aapt2/java/JavaClassGenerator.cpp