aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main/kotlin
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-06-19 18:50:57 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-06-20 16:15:48 +0300
commitdff07a0aa73df1a9986d160ca7f97677d049ffeb (patch)
tree46d07df547f4d397a555f2f199751e25da848570 /runners/gradle-plugin/src/main/kotlin
parent60858d8697231674c055bd30b34950d9859a6f32 (diff)
downloaddokka-dff07a0aa73df1a9986d160ca7f97677d049ffeb.tar.gz
dokka-dff07a0aa73df1a9986d160ca7f97677d049ffeb.tar.bz2
dokka-dff07a0aa73df1a9986d160ca7f97677d049ffeb.zip
Prevent early evaluation of kotlinTasks. To work with kotlin-android
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/main.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt
index bd4b3ab3..fd4053ee 100644
--- a/runners/gradle-plugin/src/main/kotlin/main.kt
+++ b/runners/gradle-plugin/src/main/kotlin/main.kt
@@ -21,6 +21,7 @@ import java.io.InputStream
import java.io.Serializable
import java.net.URLClassLoader
import java.util.*
+import java.util.concurrent.Callable
import java.util.function.BiConsumer
open class DokkaPlugin : Plugin<Project> {
@@ -53,10 +54,10 @@ object ClassloaderContainer {
open class DokkaTask : DefaultTask() {
fun defaultKotlinTasks() = with(ReflectDsl) {
-
val abstractKotlinCompileClz = try {
project.buildscript.classLoader.loadClass(ABSTRACT_KOTLIN_COMPILE)
} catch (cnfe: ClassNotFoundException) {
+ logger.warn("$ABSTRACT_KOTLIN_COMPILE class not found, default kotlin tasks ignored")
return@with emptyList<Task>()
}
@@ -66,9 +67,9 @@ open class DokkaTask : DefaultTask() {
init {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Generates dokka documentation for Kotlin"
- project.afterEvaluate {
- this.dependsOn(kotlinTasks.flatMap { it.dependsOn })
- }
+
+ @Suppress("LeakingThis")
+ dependsOn(Callable { kotlinTasks.flatMap { it.dependsOn } })
}
@Input