From 04df5c458239fb1966768af85de4d105a3c43233 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Fri, 28 Jun 2019 15:52:36 +0200 Subject: Add error message when sources from kotlin tasks cannot be extracted --- .../org/jetbrains/dokka/gradle/ConfigurationExtractor.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'runners/gradle-plugin/src/main') 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 = it["sourceRootsContainer"]["sourceRoots"].v() - val abstractKotlinCompileClz = DokkaTask.getAbstractKotlinCompileFor(it)!! + val taskSourceRoots: List + val abstractKotlinCompileClz: Class + 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 = (it["getClasspath", AbstractCompile::class].takeIfIsFunc()?.invoke() -- cgit