Skip to content

Commit a92a157

Browse files
Update top-level javadoc
Gradle 9 is pretty strict about enforcing its concurrency model, which tripped up our consolidated javadoc generation. This updates that so that we are explicitly depending on each subproject in the javadoc task and adding the classpath files as an input.
1 parent b09d484 commit a92a157

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

build.gradle.kts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,18 @@ afterEvaluate {
4444
javadoc {
4545
title = "Smithy API ${version}"
4646
setDestinationDir(layout.buildDirectory.dir("docs/javadoc/latest").get().asFile)
47-
source(subprojects.map { project(it.path).sourceSets.main.get().allJava })
48-
classpath = files(subprojects.map { project(it.path).sourceSets.main.get().compileClasspath })
47+
48+
// Add an explicit dependencies on the compilation of each subproject because we need
49+
// the compile classpath, which we can only get after the compile task has completed.
50+
dependsOn(subprojects.map { it.tasks.named("compileJava") })
51+
classpath = files(provider {
52+
subprojects.flatMap { subproject ->
53+
subproject.configurations.getByName("compileClasspath").resolve()
54+
}
55+
})
56+
57+
source(provider { subprojects.map { project -> project.sourceSets.main.get().allJava } })
58+
4959
(options as StandardJavadocDocletOptions).apply {
5060
addStringOption("Xdoclint:-html", "-quiet")
5161
}

0 commit comments

Comments
 (0)