aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-04-29 16:07:13 +0200
committerKamil Doległo <kamilok1965@interia.pl>2019-04-29 16:07:13 +0200
commit885ddd8cfffeb39d837fbd545e009c2cd93e983e (patch)
treee75b125091e7565972755017b708ea776e2622b9 /runners/gradle-plugin/src
parent1f2ceb505aeb67fb21a483711a9bdbcebe3d9e0b (diff)
downloaddokka-885ddd8cfffeb39d837fbd545e009c2cd93e983e.tar.gz
dokka-885ddd8cfffeb39d837fbd545e009c2cd93e983e.tar.bz2
dokka-885ddd8cfffeb39d837fbd545e009c2cd93e983e.zip
Fix Gradle incremental build
Diffstat (limited to 'runners/gradle-plugin/src')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt18
1 files changed, 17 insertions, 1 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
index d289237f..d4eee4b2 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
@@ -61,7 +61,7 @@ open class DokkaTask : DefaultTask() {
var sourceDirs: Iterable<File> = emptyList()
@Input
- var sourceRoots: MutableList<DokkaConfiguration.SourceRoot> = arrayListOf()
+ var sourceRoots: MutableList<SourceRoot> = arrayListOf()
@Input
var dokkaFatJar: Any = "org.jetbrains.dokka:dokka-fatjar:${DokkaVersion.version}"
@@ -265,6 +265,22 @@ open class DokkaTask : DefaultTask() {
return sourceRoots + (sourceDirs?.toSourceRoots() ?: emptyList())
}
+ /**
+ * Needed for Gradle incremental build
+ */
+ @OutputDirectory
+ fun getOutputDirectoryAsFile(): File = project.file(outputDirectory)
+
+ /**
+ * Needed for Gradle incremental build
+ */
+ @InputFiles
+ fun getInputFiles(): FileCollection {
+ val (_, tasksSourceRoots) = extractClasspathAndSourceRootsFromKotlinTasks()
+ return project.files(tasksSourceRoots.map { project.fileTree(it) }) +
+ project.files(collectSourceRoots().map { project.fileTree(File(it.path)) })
+ }
+
companion object {
const val COLORS_ENABLED_PROPERTY = "kotlin.colors.enabled"
const val ABSTRACT_KOTLIN_COMPILE = "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile"