/
AbstractDokkaLeafTask.kt
35 lines (31 loc) · 1.46 KB
/
AbstractDokkaLeafTask.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package org.jetbrains.dokka.gradle
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.internal.plugins.DslObject
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Nested
import org.gradle.work.DisableCachingByDefault
@DisableCachingByDefault(because = "Abstract super-class, not to be instantiated directly")
abstract class AbstractDokkaLeafTask : AbstractDokkaTask() {
@get:Internal
val dokkaSourceSets: NamedDomainObjectContainer<GradleDokkaSourceSetBuilder> =
project.container(GradleDokkaSourceSetBuilder::class.java, gradleDokkaSourceSetBuilderFactory())
.also { container ->
DslObject(this).extensions.add("dokkaSourceSets", container)
project.kotlinOrNull?.sourceSets?.all { kotlinSourceSet ->
container.register(kotlinSourceSet.name) { dokkaSourceSet ->
dokkaSourceSet.configureWithKotlinSourceSet(kotlinSourceSet)
}
}
}
/**
* Only contains source sets that are marked with `isDocumented`.
* Non documented source sets are not relevant for Gradle's UP-TO-DATE mechanism, as well
* as task dependency graph.
*/
@get:Nested
protected val unsuppressedSourceSets: List<GradleDokkaSourceSetBuilder>
get() = dokkaSourceSets
.toList()
.also(::checkSourceSetDependencies)
.filterNot { it.suppress.getSafe() }
}