Skip to content

Apache Lucene open-source search software

Add initial support for rendering javadocs.

Dawid Weiss3beb1cfd1e56
diff --git a/build.gradle b/build.gradle
index 3a3f6e55447..0f4768de19a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -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')
diff --git a/gradle/defaults-javadoc.gradle b/gradle/defaults-javadoc.gradle
new file mode 100644
index 00000000000..cf6a8d416bd
--- /dev/null
+++ b/gradle/defaults-javadoc.gradle
@@ -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>"
+ }
+ }
+}
diff --git a/solr/solr-ref-guide/build.gradle b/solr/solr-ref-guide/build.gradle
index 4201ce09e1c..a1d658f3780 100644
--- a/solr/solr-ref-guide/build.gradle
+++ b/solr/solr-ref-guide/build.gradle
@@ -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 = [