summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2016-05-16 13:29:54 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-05-16 13:29:54 +0000
commit837b33ab9ce9fcbbdb795ff7f5fbec4be6f9f2a0 (patch)
tree578a69b68f4172a37a059e685a7b9109e73060a8 /tools/aapt2/java/JavaClassGenerator.cpp
parent883c25a510b62c33c1e95f3195a2566716c4981b (diff)
parent365eaeef5fb511225f979fc2b55a32cbdcbd933c (diff)
Merge "Stop emitting javadoc for @removed attributes." into nyc-dev am: c4033e7c66
am: 365eaeef5f * commit '365eaeef5fb511225f979fc2b55a32cbdcbd933c': Stop emitting javadoc for @removed attributes. Change-Id: Ib62aa382b5f626f98c1b560e0483a243d960d0e8
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
-rw-r--r--tools/aapt2/java/JavaClassGenerator.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp
index 24347a1cdc1e..84df0b429fc5 100644
--- a/tools/aapt2/java/JavaClassGenerator.cpp
+++ b/tools/aapt2/java/JavaClassGenerator.cpp
@@ -284,6 +284,13 @@ void JavaClassGenerator::addMembersToStyleableClass(const StringPiece16& package
continue;
}
+ StringPiece16 attrCommentLine = entry.symbol->attribute->getComment();
+ if (attrCommentLine.contains(StringPiece16(u"@removed"))) {
+ // Removed attributes are public but hidden from the documentation, so don't emit
+ // them as part of the class documentation.
+ continue;
+ }
+
const ResourceName& attrName = entry.attrRef->name.value();
styleableComment << "<tr><td>";
styleableComment << "<code>{@link #"
@@ -299,7 +306,6 @@ void JavaClassGenerator::addMembersToStyleableClass(const StringPiece16& package
// Only use the comment up until the first '.'. This is to stay compatible with
// the way old AAPT did it (presumably to keep it short and to avoid including
// annotations like @hide which would affect this Styleable).
- StringPiece16 attrCommentLine = entry.symbol->attribute->getComment();
auto iter = std::find(attrCommentLine.begin(), attrCommentLine.end(), u'.');
if (iter != attrCommentLine.end()) {
attrCommentLine = attrCommentLine.substr(
@@ -348,6 +354,17 @@ void JavaClassGenerator::addMembersToStyleableClass(const StringPiece16& package
continue;
}
+ StringPiece16 comment = styleableAttr.attrRef->getComment();
+ if (styleableAttr.symbol->attribute && comment.empty()) {
+ comment = styleableAttr.symbol->attribute->getComment();
+ }
+
+ if (comment.contains(StringPiece16(u"@removed"))) {
+ // Removed attributes are public but hidden from the documentation, so don't emit them
+ // as part of the class documentation.
+ continue;
+ }
+
const ResourceName& attrName = styleableAttr.attrRef->name.value();
StringPiece16 packageName = attrName.package;
@@ -360,11 +377,6 @@ void JavaClassGenerator::addMembersToStyleableClass(const StringPiece16& package
AnnotationProcessor* attrProcessor = indexMember->getCommentBuilder();
- StringPiece16 comment = styleableAttr.attrRef->getComment();
- if (styleableAttr.symbol->attribute && comment.empty()) {
- comment = styleableAttr.symbol->attribute->getComment();
- }
-
if (!comment.empty()) {
attrProcessor->appendComment("<p>\n@attr description");
attrProcessor->appendComment(comment);