mocobeta commented on a change in pull request #1304: LUCENE-9242: generate javadocs by calling Ant javadoc task URL: https://github.com/apache/lucene-solr/pull/1304#discussion_r389317438
########## File path: gradle/invoke-javadoc.gradle ########## @@ -0,0 +1,335 @@ +/* + * 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. + */ + +// invoke javadoc tool + +allprojects { + + ext { + javadocRoot = project.path.startsWith(':lucene') ? project(':lucene').file("build/docs") : project(':solr').file("build/docs") + javadocDestDir = "${javadocRoot}/${project.name}" + } + + plugins.withType(JavaPlugin) { + def libName = project.path.startsWith(":lucene") ? "Lucene" : "Solr" + def title = "${libName} ${project.version} ${project.name} API".toString() + def srcDirs = sourceSets.main.java.srcDirs.findAll { dir -> dir.exists() } + + task invokeJavadoc { + description "Generates Javadoc API documentation for the main source code. This invokes Ant Javadoc Task." + group "documentation" + + dependsOn sourceSets.main.compileClasspath + + inputs.property("linksource", "no") + inputs.property("linkJUnit", false) + inputs.property("linkHref", []) + + inputs.files sourceSets.main.java.asFileTree + outputs.dir project.javadocRoot + + doFirst { + srcDirs.each { srcDir -> Review comment: Instead of repeatly invoking ant.javadoc, I added (possibly multiple) `packageset`s to the javadoc task. For now, all projects have only one main source directory, so only one packageset element will be created by this code. ``` srcDirs.collect { srcDir -> packageset(dir: srcDir) } ``` Does this change make sense? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org