aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
index 921b6418..295cacb6 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
@@ -5,6 +5,7 @@ import org.gradle.api.file.FileCollection
import org.jetbrains.dokka.gradle.isAndroidTarget
import org.jetbrains.dokka.utilities.cast
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
+import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
internal fun Project.classpathOf(sourceSet: KotlinSourceSet): FileCollection {
@@ -21,10 +22,16 @@ internal fun Project.classpathOf(sourceSet: KotlinSourceSet): FileCollection {
}
}
-private fun compileClasspathOf(compilation: KotlinCompilation): FileCollection {
+private fun Project.compileClasspathOf(compilation: KotlinCompilation): FileCollection {
if (compilation.target.isAndroidTarget()) {
// This is a workaround for https://youtrack.jetbrains.com/issue/KT-33893
return compilation.compileKotlinTask.cast<KotlinCompile>().classpath
}
- return compilation.compileDependencyFiles
+
+ val platformDependencyFiles: FileCollection = (compilation as? KotlinNativeCompilation)
+ ?.target?.project?.configurations
+ ?.findByName(compilation.defaultSourceSet.implementationMetadataConfigurationName)
+ ?: files()
+
+ return compilation.compileDependencyFiles + platformDependencyFiles
}