summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/AnnotationProcessor.cpp
AgeCommit message (Collapse)Author
2020-06-22Don't add API annotations in the internal R.javaMakoto Onuki
I'm trying to enable a check for the following structure: ``` /** @hide */ public class Class1 { /** @hide */ @SystemApi // Invalid because the class is hidden. public void method1() { } } ``` The internal R.java file violates this, which this change is going to fix. Bug: 159162473 Test: build (treehugger) Test: atest aapt2_tests Change-Id: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
2020-03-26aapt2: Preserve annotation parameters for SystemApi.Narayan Kamath
SystemAPI can now be parameterized. Note that this change preserves the content of the annotation params without attempting to interpret them in any way. This means that references to types outside of java.lang must be fully qualified. Test: atest aapt2_tests Bug: 147581540 Change-Id: I0630fb1c7c7a7f5918ff2dca32fb8e078b367751
2018-12-17Fix performance-for-range-copy warningsChih-Hung Hsieh
Bug: 30413223 Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance* Change-Id: Ie481e88025a7a1f3abde8ff63420d5ccd8577e52
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-08-08AAPT2: Forward @TestApi in resource comments to JavaDocAdam Lesinski
Bug: 37894597 Test: make aapt2_tests Change-Id: I357fb84941bfbb3892a8c46feb47f55b865b6649
2017-07-25AAPT2: Fix JavaDoc first sentence extraction.Adam Lesinski
The old algorithm for detecting the first sentence of a JavaDoc comment looked for the first occurence of '.'. This does not work when code or a {@link android.R.styleable} link is encountered in the first sentence. Switch to checking for whitespace characters after the '.' character. Bug: 62900335 Test: make aapt2_tests Change-Id: I8238f6a6304c9c2f92e2e576ca8962a59c2b20ea
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-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-07AAPT2: Clean up R JavaDoc generationAdam Lesinski
- 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
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-11-02AAPT2: Add support for comments in R.javaAdam Lesinski
Change-Id: Iaa5f3b75bf7de9dbf458fa5c452f7312989f4c4f
2015-10-30AAPT2: Support generating Manifest.javaAdam Lesinski
This includes comments from AndroidManifest.xml. Change-Id: I412d9ecb12bad20a49a683d6b3bea4a0be1235ae