Add initial support for rendering javadocs.

This commit is contained in:
Dawid Weiss 2020-01-10 16:43:52 +01:00
parent 5e2396d9fe
commit 3beb1cfd1e
3 changed files with 48 additions and 5 deletions

View File

@ -1,3 +1,5 @@
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins {
id "base"
@ -10,6 +12,13 @@ allprojects {
version = "9.0.0-SNAPSHOT"
}
ext {
def tstamp = ZonedDateTime.now()
buildDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(tstamp)
buildTime = DateTimeFormatter.ofPattern("HH:mm:ss").format(tstamp)
buildYear = DateTimeFormatter.ofPattern("yyyy").format(tstamp)
}
// Include smaller chunks configuring dedicated build areas.
// Some of these intersect or add additional functionality.
// The order of inclusion of these files shouldn't matter (but may
@ -22,6 +31,7 @@ apply from: file('gradle/generate-defaults.gradle')
// (java, tests)
apply from: file('gradle/defaults.gradle')
apply from: file('gradle/defaults-java.gradle')
apply from: file('gradle/defaults-javadoc.gradle')
apply from: file('gradle/testing/defaults-tests.gradle')
apply from: file('gradle/testing/randomization.gradle')
apply from: file('gradle/testing/fail-on-no-tests.gradle')

View File

@ -0,0 +1,38 @@
// Configure javadoc defaults.
allprojects {
plugins.withType(JavaPlugin) {
tasks.matching { it.name == "javadoc" }.all {
StandardJavadocDocletOptions opts = (options as StandardJavadocDocletOptions)
opts.locale("en_US")
opts.charSet = "UTF-8"
opts.encoding = "UTF-8"
opts.docEncoding = "UTF-8"
opts.noIndex()
opts.memberLevel = JavadocMemberLevel.PROTECTED
opts.version = true
opts.author = true
opts.use = true
opts.linksOffline(
"https://docs.oracle.com/en/java/javase/11/docs/api/",
project(":lucene").file("tools/javadoc/java11/").toString())
opts.tags(
"lucene.experimental:a:WARNING: This API is experimental and might change in incompatible ways in the next release.",
"lucene.internal:a:NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.",
"lucene.spi:t:SPI Name (Note: This is case-insensitive. e.g., if the name is 'htmlStrip', 'htmlstrip' can be used when looking up the service).",
)
opts.addStringOption("-release", "11")
opts.addBooleanOption('Xdoclint:all,-accessibility,-missing,-html,-syntax', true)
def libName = project.path.startsWith(":lucene") ? "Lucene" : "Solr"
opts.overview = file("src/main/java/overview.html").toString()
opts.docTitle = "${libName} ${project.version} ${project.name} API"
opts.windowTitle = "${libName} ${project.version} ${project.name} API"
opts.bottom = "<i>Copyright &copy; 2000-${buildYear} Apache Software Foundation. All Rights Reserved.</i>"
}
}
}

View File

@ -119,11 +119,6 @@ ext {
bareBonesDir = file("${buildDir}/bare-bones-html")
def tstamp = ZonedDateTime.now()
buildDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(tstamp)
buildTime = DateTimeFormatter.ofPattern("HH:mm:ss").format(tstamp)
buildYear = DateTimeFormatter.ofPattern("yyyy").format(tstamp)
// Some additional version properties are lazily computed
// in setupLazyProps (because they need to be computed after evaluation is complete).
props = [