aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Haughton <3flex@users.noreply.github.com>2022-05-18 19:18:37 +1000
committerGitHub <noreply@github.com>2022-05-18 11:18:37 +0200
commit3dc0e7777a3d45c8b4b1e9ac91e76836a4eb4737 (patch)
tree5d92c731d76192c9bb8afa91d0e1fc50dec264fe
parenta070853d9cc4d441184fe4a84afc4d55da88b103 (diff)
downloaddokka-3dc0e7777a3d45c8b4b1e9ac91e76836a4eb4737.tar.gz
dokka-3dc0e7777a3d45c8b4b1e9ac91e76836a4eb4737.tar.bz2
dokka-3dc0e7777a3d45c8b4b1e9ac91e76836a4eb4737.zip
Enable stricter validation for cacheable Gradle tasks (#2500)
* Enable stricter validation for cacheable tasks * Address Gradle plugin strict validation violations
-rw-r--r--runners/gradle-plugin/build.gradle.kts4
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTask.kt2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt2
4 files changed, 10 insertions, 0 deletions
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts
index 7cc5266d..95ffd9ef 100644
--- a/runners/gradle-plugin/build.gradle.kts
+++ b/runners/gradle-plugin/build.gradle.kts
@@ -92,6 +92,10 @@ publishing {
}
}
+tasks.validatePlugins {
+ enableStricterValidation.set(true)
+}
+
tasks.withType<PublishToMavenRepository>().configureEach {
onlyIf { publication != publishing.publications["dokkaGradlePluginForIntegrationTests"] }
}
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 74125956..412695ec 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
@@ -4,7 +4,9 @@ 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
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTask.kt
index ad17a67d..92314c52 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTask.kt
@@ -4,7 +4,9 @@ import org.gradle.api.Project
import org.gradle.api.Task
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 AbstractDokkaParentTask : AbstractDokkaTask() {
@get:Internal
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt
index 1123328a..a654f9d5 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt
@@ -12,6 +12,7 @@ import org.gradle.api.provider.Property
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.listProperty
import org.gradle.kotlin.dsl.mapProperty
+import org.gradle.work.DisableCachingByDefault
import org.jetbrains.dokka.*
import org.jetbrains.dokka.plugability.ConfigurableBlock
import org.jetbrains.dokka.plugability.DokkaPlugin
@@ -19,6 +20,7 @@ import java.io.File
import java.util.function.BiConsumer
import kotlin.reflect.full.createInstance
+@DisableCachingByDefault(because = "Abstract super-class, not to be instantiated directly")
abstract class AbstractDokkaTask : DefaultTask() {
@Input