diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-06-28 15:52:36 +0200 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-06-28 15:52:53 +0200 |
commit | 04df5c458239fb1966768af85de4d105a3c43233 (patch) | |
tree | 4be72b0818dd2b87ceb65daea36252ffeb2d7070 | |
parent | 72b45b70f207e8d289db1ee6554722472b7430e7 (diff) | |
download | dokka-04df5c458239fb1966768af85de4d105a3c43233.tar.gz dokka-04df5c458239fb1966768af85de4d105a3c43233.tar.bz2 dokka-04df5c458239fb1966768af85de4d105a3c43233.zip |
Add error message when sources from kotlin tasks cannot be extracted
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt | 11 |
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() |