Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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())
}
}

Expand Down