aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src
diff options
context:
space:
mode:
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"