LUCENE-9201: remove javadoc task remnants. Make javadoc depend on renderJavadoc and skip the default gradle's implementation.

This commit is contained in:
Dawid Weiss 2020-04-12 12:55:56 +02:00
parent fea1ce0062
commit 9244558752
3 changed files with 10 additions and 78 deletions

View File

@ -77,7 +77,6 @@ apply from: file('gradle/ant-compat/folder-layout.gradle')
// (java, tests) // (java, tests)
apply from: file('gradle/defaults.gradle') apply from: file('gradle/defaults.gradle')
apply from: file('gradle/defaults-java.gradle') apply from: file('gradle/defaults-java.gradle')
apply from: file('gradle/defaults-javadoc.gradle')
apply from: file('gradle/render-javadoc.gradle') apply from: file('gradle/render-javadoc.gradle')
apply from: file('gradle/testing/defaults-tests.gradle') apply from: file('gradle/testing/defaults-tests.gradle')
apply from: file('gradle/testing/randomization.gradle') apply from: file('gradle/testing/randomization.gradle')

View File

@ -1,77 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Configure javadoc defaults.
allprojects {
plugins.withType(JavaPlugin) {
tasks.matching { it.name == "javadoc" }.all {
StandardJavadocDocletOptions opts = (options as StandardJavadocDocletOptions)
opts.locale("en_US")
opts.setJFlags(["-Duser.language=en", "-Duser.country=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 (case-insensitive: if the name is 'htmlStrip', 'htmlstrip' can be used when looking up the service).",
)
opts.addStringOption("-release", "11")
opts.addBooleanOption('Xdoclint:all,-missing', true)
def libName = project.path.startsWith(":lucene") ? "Lucene" : "Solr"
opts.overview = file("src/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>"
}
}
}
// https://issues.apache.org/jira/browse/LUCENE-9132: Add apache yetus so that javadoc doesn't fail
configure([
project(":solr:solrj"),
project(":solr:core"),
project(":solr:test-framework"),
]) {
configurations {
javadocFix
}
dependencies {
javadocFix("org.apache.yetus:audience-annotations:0.11.1")
}
plugins.withType(JavaPlugin) {
javadoc {
classpath += configurations.javadocFix.asFileTree
}
}
}

View File

@ -24,6 +24,16 @@ def pathToDocdir = { path -> path.split(':').drop(2).join('/') }
allprojects { allprojects {
plugins.withType(JavaPlugin) { plugins.withType(JavaPlugin) {
// We disable the default javadoc task and have our own
// javadoc rendering task below. The default javadoc task
// will just invoke 'renderJavadoc' (to allow people to call
// conventional task name).
tasks.matching { it.name == "javadoc" }.all {
enabled = false
dependsOn "renderJavadoc"
}
task renderJavadoc { task renderJavadoc {
description "Generates Javadoc API documentation for the main source code. This directly invokes javadoc tool." description "Generates Javadoc API documentation for the main source code. This directly invokes javadoc tool."
group "documentation" group "documentation"