@@ -7,23 +7,15 @@ dependencies {
77 api(project(" :langsmith-java-client-okhttp" ))
88}
99
10- // Redefine `dokkaJavadoc` to:
11- // - Depend on the root project's task for merging the docs of all the projects
12- // - Forward that task's output to this task's output
13- tasks.named(" dokkaJavadoc" ).configure {
14- actions.clear()
15-
16- val dokkaJavadocCollector = rootProject.tasks[" dokkaJavadocCollector" ]
17- dependsOn(dokkaJavadocCollector)
18-
19- val outputDirectory = project.layout.buildDirectory.dir(" dokka/javadoc" )
20- doLast {
21- copy {
22- from(dokkaJavadocCollector.outputs.files)
23- into(outputDirectory)
24- duplicatesStrategy = DuplicatesStrategy .INCLUDE
25- }
26- }
27-
28- outputs.dir(outputDirectory)
10+ // The umbrella `langsmith-java` artifact contains no source of its own, but we still publish a
11+ // Javadoc JAR containing the docs for the modules it re-exports.
12+ tasks.named< org.gradle.jvm.tasks.Jar > (" dokkaJavadocJar" ).configure {
13+ val reexportedProjects = setOf (" langsmith-java-client-okhttp" , " langsmith-java-core" )
14+ val subprojectJavadocTasks =
15+ rootProject.subprojects
16+ .filter { it.name in reexportedProjects }
17+ .map { it.tasks.named(" dokkaGeneratePublicationJavadoc" ) }
18+ dependsOn(subprojectJavadocTasks)
19+ subprojectJavadocTasks.forEach { from(it) }
20+ duplicatesStrategy = DuplicatesStrategy .INCLUDE
2921}
0 commit comments