Skip to content

Commit

Permalink
Disable caching on kover artifact tasks
Browse files Browse the repository at this point in the history
Caching should only be enabled for tasks that do heavy computations
and this task does not do so.

PR #637
  • Loading branch information
remcomokveld authored Jun 18, 2024
1 parent 85c5881 commit 224671b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BuildCacheRelocationTests {
val result2 = gradleBuild2.runWithParams("koverXmlReport", "koverHtmlReport", "koverBinaryReport", "koverVerify", "--build-cache", "--info")
try {
assertEquals("FROM-CACHE", result2.taskOutcome(":test"))
assertEquals("FROM-CACHE", result2.taskOutcome(":koverGenerateArtifact"))
assertEquals("SUCCESS", result2.taskOutcome(":koverGenerateArtifact"))
assertEquals("FROM-CACHE", result2.taskOutcome(":koverXmlReport"))
assertEquals("FROM-CACHE", result2.taskOutcome(":koverHtmlReport"))
assertEquals("FROM-CACHE", result2.taskOutcome(":koverBinaryReport"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.*
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
import org.gradle.work.DisableCachingByDefault
import java.io.*
import javax.inject.*

Expand All @@ -19,7 +20,7 @@ import javax.inject.*
*
* This artifact that will be shared between projects through dependencies for creating merged reports.
*/
@CacheableTask
@DisableCachingByDefault(because = "The task action is so quick that cache does not provide a benefit")
internal abstract class KoverArtifactGenerationTask : DefaultTask() {
@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
Expand Down

0 comments on commit 224671b

Please sign in to comment.