diff options
| author | Andrew Solovay <asolovay@google.com> | 2017-07-28 17:00:34 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-07-28 17:00:34 +0000 |
| commit | aa6f03639a3cfbcdc0ea9849c6dac2ae58d2c529 (patch) | |
| tree | 12305e053c3494b6e0d769747f46e5ee6cbf875e /tools/aapt2/java/JavaClassGenerator.cpp | |
| parent | bb0dff9917899a1316f531519713fb0f006e0706 (diff) | |
| parent | 18dc03a9fd87b544eef9ef701f676a7c5306594c (diff) | |
Merge "Cherry-pick from master: AAPT2: Fix JavaDoc first sentence extraction." into oc-mr1-dev
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
| -rw-r--r-- | tools/aapt2/java/JavaClassGenerator.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp index 2a23aa9e5372..44fa0f19a0e5 100644 --- a/tools/aapt2/java/JavaClassGenerator.cpp +++ b/tools/aapt2/java/JavaClassGenerator.cpp @@ -299,24 +299,16 @@ void JavaClassGenerator::ProcessStyleable(const ResourceNameRef& name, const Res } const ResourceName& attr_name = entry.attr_ref->name.value(); - styleable_comment << "<tr><td>"; - styleable_comment << "<code>{@link #" << entry.field_name << " " - << (!attr_name.package.empty() - ? attr_name.package - : context_->GetCompilationPackage()) - << ":" << attr_name.entry << "}</code>"; - styleable_comment << "</td>"; - - styleable_comment << "<td>"; + styleable_comment << "<tr><td><code>{@link #" << entry.field_name << " " + << (!attr_name.package.empty() ? attr_name.package + : context_->GetCompilationPackage()) + << ":" << attr_name.entry << "}</code></td>"; // 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). - auto iter = std::find(attr_comment_line.begin(), attr_comment_line.end(), '.'); - if (iter != attr_comment_line.end()) { - attr_comment_line = attr_comment_line.substr(0, (iter - attr_comment_line.begin()) + 1); - } - styleable_comment << attr_comment_line << "</td></tr>\n"; + styleable_comment << "<td>" << AnnotationProcessor::ExtractFirstSentence(attr_comment_line) + << "</td></tr>\n"; } styleable_comment << "</table>\n"; |
