File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,10 @@ abstract class KotlinAdapter @Inject constructor(
181181
182182 private fun determineClasspath (
183183 details : KotlinSourceSetDetails
184- ): Provider <FileCollection > {
185- return details.primaryCompilations.map { compilations: List <KotlinCompilationDetails > ->
184+ ): FileCollection {
185+ val aggregatedClasspath = objects.fileCollection()
186+
187+ val directClasspath = details.primaryCompilations.map { compilations: List <KotlinCompilationDetails > ->
186188 val classpath = objects.fileCollection()
187189
188190 if (compilations.isNotEmpty()) {
@@ -195,6 +197,24 @@ abstract class KotlinAdapter @Inject constructor(
195197 .from(details.sourceDirectoriesOfDependents)
196198 }
197199 }
200+ aggregatedClasspath.from(directClasspath)
201+
202+ val combinedClasspath = details.allCompilations.map { compilations: List <KotlinCompilationDetails > ->
203+ val classpath = objects.fileCollection()
204+
205+ if (compilations.none { it.isMetadata }) {
206+ logger.info(" [$dkaName ] No metadata compilation found for ${details.name} . The classpath of all compilations will also be used." )
207+ classpath.from(compilations.map { it.compilationClasspath })
208+ compilations.fold(classpath) { acc, compilation ->
209+ acc.from(compilation.compilationClasspath)
210+ }
211+ }
212+
213+ classpath
214+ }
215+ aggregatedClasspath.from(combinedClasspath)
216+
217+ return aggregatedClasspath
198218 }
199219
200220 @InternalDokkaGradlePluginApi
You can’t perform that action at this time.
0 commit comments