aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main
diff options
context:
space:
mode:
authorKamil Doległo <9080183+kamildoleglo@users.noreply.github.com>2021-05-17 18:05:05 +0200
committerGitHub <noreply@github.com>2021-05-17 18:05:05 +0200
commitc94c4baedb6571f27c8a99a419f9bb4c26c4885a (patch)
tree06b636032b4b77f512c32bdf8e8563765b9f0fda /runners/gradle-plugin/src/main
parent76c26f3325ebe0c06779fca09bbef0eefac5aa5a (diff)
downloaddokka-c94c4baedb6571f27c8a99a419f9bb4c26c4885a.tar.gz
dokka-c94c4baedb6571f27c8a99a419f9bb4c26c4885a.tar.bz2
dokka-c94c4baedb6571f27c8a99a419f9bb4c26c4885a.zip
Extract properties to AbstractDokkaLeafTask (#1922)
Diffstat (limited to 'runners/gradle-plugin/src/main')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt15
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt20
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTaskPartial.kt18
3 files changed, 17 insertions, 36 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt
index 96f43c77..f10f32ec 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt
@@ -3,8 +3,9 @@ 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
-abstract class AbstractDokkaLeafTask() : AbstractDokkaTask() {
+abstract class AbstractDokkaLeafTask : AbstractDokkaTask() {
@get:Internal
val dokkaSourceSets: NamedDomainObjectContainer<GradleDokkaSourceSetBuilder> =
@@ -17,4 +18,16 @@ abstract class AbstractDokkaLeafTask() : AbstractDokkaTask() {
}
}
}
+
+ /**
+ * 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() }
}
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 48584786..682b2591 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
@@ -1,25 +1,9 @@
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.jetbrains.dokka.*
+import org.jetbrains.dokka.DokkaConfigurationImpl
+import org.jetbrains.dokka.build
abstract class DokkaTask : AbstractDokkaLeafTask() {
-
- /**
- * 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() }
-
override fun buildDokkaConfiguration(): DokkaConfigurationImpl =
DokkaConfigurationImpl(
moduleName = moduleName.getSafe(),
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTaskPartial.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTaskPartial.kt
index 39c0bab2..ce779c99 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTaskPartial.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTaskPartial.kt
@@ -1,26 +1,10 @@
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.jetbrains.dokka.DokkaConfigurationImpl
import org.jetbrains.dokka.build
abstract class DokkaTaskPartial : AbstractDokkaLeafTask() {
- /**
- * 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() }
-
override fun buildDokkaConfiguration(): DokkaConfigurationImpl {
return DokkaConfigurationImpl(
moduleName = moduleName.getSafe(),
@@ -37,4 +21,4 @@ abstract class DokkaTaskPartial : AbstractDokkaLeafTask() {
suppressInheritedMembers = suppressInheritedMembers.getSafe(),
)
}
-} \ No newline at end of file
+}