This is an automated email from the ASF dual-hosted git repository.

jhyde pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite-avatica.git

commit 5000dd81087ad040f0c08319c076f920e63e696a
Author: Julian Hyde <[email protected]>
AuthorDate: Wed Nov 20 13:54:29 2019 -0800

    Add gradle task 'aggregateJavadocIncludingTests' that builds javadoc for 
both main and test
    
    It will allow CI to spot javadoc errors, for example broken links, in test 
code.
    
    Close apache/calcite-avatica#117
---
 build.gradle.kts | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/build.gradle.kts b/build.gradle.kts
index 13ee9eb..3953296 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -152,6 +152,20 @@ val javadocAggregate by tasks.registering(Javadoc::class) {
     setDestinationDir(file("$buildDir/docs/javadocAggregate"))
 }
 
+/** Similar to {@link #javadocAggregate} but includes tests.
+ * CI uses this target to validate javadoc (e.g. checking for broken links). */
+val javadocAggregateIncludingTests by tasks.registering(Javadoc::class) {
+    description = "Generates aggregate javadoc for all the artifacts, 
including test code"
+
+    val sourceSets = allprojects
+        .mapNotNull { it.extensions.findByType<SourceSetContainer>() }
+        .flatMap { listOf(it.named("main"), it.named("test")) }
+
+    classpath = files(sourceSets.map { set -> set.map { it.output + 
it.compileClasspath } })
+    setSource(sourceSets.map { set -> set.map { it.allJava } })
+    setDestinationDir(file("$buildDir/docs/javadocAggregateIncludingTests"))
+}
+
 val licenseHeaderFile = file("config/license.header.java")
 
 allprojects {
@@ -446,7 +460,7 @@ allprojects {
 
         // Note: jars below do not normalize line endings.
         // Those jars, however are not included to source/binary distributions
-        // so the normailzation is not that important
+        // so the normalization is not that important
 
         val testJar by tasks.registering(Jar::class) {
             from(sourceSets["test"].output)

Reply via email to