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 @@ -163,8 +163,10 @@ abstract class KotlinAdapter @Inject constructor(
163163
164164 private fun determineClasspath (
165165 details : KotlinSourceSetDetails
166- ): Provider <FileCollection > {
167- return details.primaryCompilations.map { compilations: List <KotlinCompilationDetails > ->
166+ ): FileCollection {
167+ val aggregatedClasspath = objects.fileCollection()
168+
169+ val directClasspath = details.primaryCompilations.map { compilations: List <KotlinCompilationDetails > ->
168170 val classpath = objects.fileCollection()
169171
170172 if (compilations.isNotEmpty()) {
@@ -177,6 +179,24 @@ abstract class KotlinAdapter @Inject constructor(
177179 .from(details.sourceDirectoriesOfDependents)
178180 }
179181 }
182+ aggregatedClasspath.from(directClasspath)
183+
184+ val combinedClasspath = details.allCompilations.map { compilations: List <KotlinCompilationDetails > ->
185+ val classpath = objects.fileCollection()
186+
187+ if (compilations.none { it.isMetadata }) {
188+ logger.info(" [$dkaName ] No metadata compilation found for ${details.name} . The classpath of all compilations will also be used." )
189+ classpath.from(compilations.map { it.compilationClasspath })
190+ compilations.fold(classpath) { acc, compilation ->
191+ acc.from(compilation.compilationClasspath)
192+ }
193+ }
194+
195+ classpath
196+ }
197+ aggregatedClasspath.from(combinedClasspath)
198+
199+ return aggregatedClasspath
180200 }
181201
182202 @InternalDokkaGradlePluginApi
You can’t perform that action at this time.
0 commit comments