diff --git a/build.gradle b/build.gradle index 493dc77f..eed62ea5 100644 --- a/build.gradle +++ b/build.gradle @@ -43,6 +43,27 @@ allprojects { } } } + + tasks.withType(Javadoc) { + /* + Javadoc Fixes, part 3 + Since JDK13 the javadoc html validator was changed, making it impossible to have javadocs + that are valid on both pre-13 and post-13 java versions. + The original workaround was suggested here: https://bugs.openjdk.java.net/browse/JDK-8223552 + However, this workaround does not work for us since we are using aggregate-javadoc. + So, we are using a workaround for the workaround from: + original: https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html + archived: https://web.archive.org/web/20210117193942/https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html + which, in turn, references this: https://github.com/GPars/GPars/blob/7cddf7cf2fec1fd66ef800edccfc03315d078a2b/build.gradle#L209 + */ + options.addBooleanOption("Xdoclint:-html", JavaVersion.current().isJava11Compatible()) + + // Enable frames support if running on java 11 + options.addBooleanOption("-frames", JavaVersion.current().isJava11()) + + // Include private and protected in the javadocs + options.memberLevel = JavadocMemberLevel.PRIVATE + } } subprojects { @@ -216,27 +237,15 @@ tasks.test.finalizedBy rootTestReport, rootJacocoMergedReport, javadoc // Root build: also run aggregateJavadoc after javadoc to generate project-wide javadocs tasks.javadoc.finalizedBy aggregateJavadoc -// Javadoc fixes (pt. 2, see above entry in subprojects) +// Javadoc fixes (pt. 2, see above entries) aggregateJavadoc.options.encoding = "UTF-8" -/* - Javadoc Fixes, part 3 - - Since JDK13 the javadoc html validator was changed, making it impossible to have javadocs - that are valid on both pre-13 and post-13 java versions. - The original workaround was suggested here: https://bugs.openjdk.java.net/browse/JDK-8223552 - However, this workaround does not work for us since we are using aggregate-javadoc. - So, we are using a workaround for the workaround from: - original: https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html - archived: https://web.archive.org/web/20210117193942/https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html - which, in turn, references this: https://github.com/GPars/GPars/blob/7cddf7cf2fec1fd66ef800edccfc03315d078a2b/build.gradle#L209 - */ -if (JavaVersion.current().isJava8Compatible()) { - allprojects { - tasks.withType(Javadoc) { - // options.addStringOption("Xdoclint:-html", "-quiet") - options.addBooleanOption("Xdoclint:-html", true) - } +task browseJavadoc { + dependsOn javadoc + description "Browse javadoc" + group = "documentation" + doLast { + java.awt.Desktop.desktop.browse new URI(("file:///" << System.getProperty("user.dir").replace('\\','/') << "/build/docs/javadoc/index.html").toString()) } }