aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main/kotlin
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-06-28 15:52:36 +0200
committerKamil Doległo <kamilok1965@interia.pl>2019-06-28 15:52:53 +0200
commit04df5c458239fb1966768af85de4d105a3c43233 (patch)
tree4be72b0818dd2b87ceb65daea36252ffeb2d7070 /runners/gradle-plugin/src/main/kotlin
parent72b45b70f207e8d289db1ee6554722472b7430e7 (diff)
downloaddokka-04df5c458239fb1966768af85de4d105a3c43233.tar.gz
dokka-04df5c458239fb1966768af85de4d105a3c43233.tar.bz2
dokka-04df5c458239fb1966768af85de4d105a3c43233.zip
Add error message when sources from kotlin tasks cannot be extracted
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin')
-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()