aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'runners/gradle-plugin')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt
index 0dc5bed1..13cda6f3 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt
@@ -73,8 +73,15 @@ object ConfigurationExtractor {
kotlinTasks.forEach {
with(ReflectDsl) {
- val taskSourceRoots: List<File> = it["sourceRootsContainer"]["sourceRoots"].v()
- val abstractKotlinCompileClz = DokkaTask.getAbstractKotlinCompileFor(it)!!
+ val taskSourceRoots: List<File>
+ val abstractKotlinCompileClz: Class<out Any>
+ try {
+ taskSourceRoots = it["sourceRootsContainer"]["sourceRoots"].v()
+ abstractKotlinCompileClz = DokkaTask.getAbstractKotlinCompileFor(it)!!
+ } catch (e: NullPointerException) {
+ println("Cannot extract sources from Kotlin tasks! Consider upgrading Kotlin Gradle Plugin")
+ return null
+ }
val taskClasspath: Iterable<File> =
(it["getClasspath", AbstractCompile::class].takeIfIsFunc()?.invoke()