Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle Javadoc documentation missing methods #2553

Closed
big-guy opened this issue Jul 21, 2017 · 12 comments
Closed

Gradle Javadoc documentation missing methods #2553

big-guy opened this issue Jul 21, 2017 · 12 comments

Comments

@big-guy
Copy link
Member

big-guy commented Jul 21, 2017

The Javadoc for StandardJavadocDocletOptions contained a setTagletPath(java.util.List) in 3.4:
https://docs.gradle.org/3.4/javadoc/org/gradle/external/javadoc/StandardJavadocDocletOptions.html#setTagletPath(java.util.List)

But in 3.5, it doesn't:
https://docs.gradle.org/3.5/javadoc/org/gradle/external/javadoc/StandardJavadocDocletOptions.html

This method wasn't removed, but it has never had any Javadoc:
https://github.com/gradle/gradle/blob/master/subprojects/language-java/src/main/java/org/gradle/external/javadoc/StandardJavadocDocletOptions.java#L941

I'm not sure what changed between 3.4 and 3.5. Maybe the minor version of Java 7 we usually build with? /cc @wolfs @donat

Since the Javadoc is the source of truth for our public APIs, this is a serious problem. @eriwen We should fix this before 4.1 final and regenerate the docs for 3.5, 4.0 and 4.0.1.

@big-guy
Copy link
Member Author

big-guy commented Jul 21, 2017

I just noticed that it's worse than that. The inherited methods are missing and the methods that do exist, don't have a "full" entry like you see in 3.4.

@jjohannes
Copy link
Contributor

It's not a general problem with our Javadoc. So it is not a serious problem as feared.

It is only with the javadoc of StandardJavadocDocletOptions. Everything is actually there in the page sources of 3.4.

The problem is that 4a091a4 moved Javadoc from private fields to public methods in StandardJavadocDocletOptions.java. So it actually added more Javadoc. Unfortunately, one of these doc blogs contains an unescaped <title>. This breaks the rendering of the page.

jjohannes added a commit that referenced this issue Jul 21, 2017
@wolfs
Copy link
Member

wolfs commented Jul 21, 2017

Can't we fail the build on invalid Javadoc?

@wolfs
Copy link
Member

wolfs commented Jul 21, 2017

Seems like we could build our Javadoc with Java 8 in some test build: http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html

@jjohannes
Copy link
Contributor

Yes. We just need to turn it on before... 🙈

options.addStringOption 'Xdoclint:none', '-quiet'

@big-guy
Copy link
Member Author

big-guy commented Jul 21, 2017

Awesome, much relieved.

jjohannes added a commit that referenced this issue Jul 24, 2017
@jjohannes jjohannes self-assigned this Jul 24, 2017
jjohannes added a commit that referenced this issue Jul 24, 2017
This activates Javadoc's syntax check. Since it is not available with
Java 7, this commit does not yet activate the check on CI, where
the Javadoc is built as part of the distribution with Java 7.

#2553
jjohannes added a commit that referenced this issue Jul 24, 2017
This fixes all warnings and errors in the html category except for:
- error: unknown attribute: autoTested

#2553
@jjohannes
Copy link
Contributor

The Javadoc fix/improvement for StandardJavadocDocletOptions and CoreJavadocOptions are now on release.

As for activating doclint(Java 8): I activated it now (not yet on CI) for the categories syntax and reference. I also would like to activate it for html, but that fails on our autoTested attribute in <pre> blocks (error: unknown attribute: autoTested).

I fixed all warnings and errors by running locally, including the html warnings except for the autoTested thing. It actually found a few things that were formatted wrong. The fixes are on release as well.

jjohannes added a commit that referenced this issue Jul 24, 2017
Our current checkstyle rules require this.

#2553
@big-guy
Copy link
Member Author

big-guy commented Jul 24, 2017

Thanks @jjohannes -- could we change <pre autoTested=''> into something supported like <pre class="autoTested">?

If doclint supported HTML5, we could use data-*, but we have to use HTML4.

@jjohannes
Copy link
Contributor

@big-guy Yes we could. Good idea. We just detect it like this:

file.text.eachMatch(/(?ms).*?<pre autoTested.*?>(.*?)<\/pre>(.*?)/)

jjohannes added a commit that referenced this issue Jul 24, 2017
For that, we changed the way of annotating auto tested examples
from <pre autoTested=''> to <pre class='autoTested'>.

#2553
@jjohannes
Copy link
Contributor

Done: 907a4e7

@jjohannes
Copy link
Contributor

Java 8 javadoc is now part of Sanity Check (fd3486c) executing the syntax, html and reference checks.

@big-guy
Copy link
Member Author

big-guy commented Jul 24, 2017

Awesome, thanks @jjohannes

@big-guy big-guy closed this as completed Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants