aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-03 14:01:47 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-14 17:51:11 +0200
commitcba413d6102173bfb4f9e1a222941388fafcac62 (patch)
treed63314b6f4eef15914e6483fcde185a57a449c7a
parent5e50c7b9d5bc9da46365f43bd6f9346f91ad36f8 (diff)
downloaddokka-cba413d6102173bfb4f9e1a222941388fafcac62.tar.gz
dokka-cba413d6102173bfb4f9e1a222941388fafcac62.tar.bz2
dokka-cba413d6102173bfb4f9e1a222941388fafcac62.zip
Re-introduce changes from aaf0e377a383f916b8dfff9dc78e4274b9b30b9c (Propagate default Kotlin/Native KLIBs to the Dokka classpath) into `kotlinClasspathUtils``
-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
}