E.g. 36h11 -> 11 * errorCorrectionRate = Max error bits + *
E.g. 36h11 = 11 * errorCorrectionRate = Max error bits */ public double errorCorrectionRate = 0; diff --git a/settings.gradle b/settings.gradle index 0555d7efab..117ee70a52 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,3 +2,4 @@ include 'photon-targeting' include 'photon-core' include 'photon-server' include 'photon-lib' +include 'docs' diff --git a/shared/common.gradle b/shared/common.gradle index 7cbf858b22..33d1a4c8b2 100644 --- a/shared/common.gradle +++ b/shared/common.gradle @@ -74,6 +74,34 @@ tasks.register('generateJavaDocs', Javadoc) { source = sourceSets.main.allJava classpath = sourceSets.main.compileClasspath destinationDir = file("${projectDir}/build/docs") + + options.addBooleanOption("Xdoclint:html,missing,reference,syntax", true) + options.addBooleanOption('html5', true) + + if (JavaVersion.current().isJava8Compatible() && project.hasProperty('docWarningsAsErrors')) { + // Treat javadoc warnings as errors. + // + // The second argument '-quiet' is a hack. The one parameter + // addStringOption() doesn't work, so we add '-quiet', which is added + // anyway by gradle. See https://github.com/gradle/gradle/issues/2354. + // + // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363) + // for information about the nonstandard -Xwerror option. JDK 15+ has + // -Werror. + options.addStringOption('Xwerror', '-quiet') + } + + if (JavaVersion.current().isJava11Compatible()) { + if (!JavaVersion.current().isJava12Compatible()) { + options.addBooleanOption('-no-module-directories', true) + } + doLast { + // This is a work-around for https://bugs.openjdk.java.net/browse/JDK-8211194. Can be removed once that issue is fixed on JDK's side + // Since JDK 11, package-list is missing from javadoc output files and superseded by element-list file, but a lot of external tools still need it + // Here we generate this file manually + new File(destinationDir, 'package-list').text = new File(destinationDir, 'element-list').text + } + } } jacoco {