Skip to content

Commit 43b1af3

Browse files
authored
Disable caching for KoverAgentJarTask
There are two cases where this task works: - for the Kover tool it just copies the jar file from dependencies to the build directory - for the JaCoCo tool it unzips the file from dependency and copies its content to the build directory For both these cases using build cache is uneffective, since local copying and uzipping are fast itself. But using build cache inflates it, and it runs slower because the build cache performs some number of additional calculations and archiving. Fixes #748 PR #754
1 parent 7c9dd3c commit 43b1af3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/plugin/tasks/services/KoverAgentJarTask.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@
44

55
package kotlinx.kover.gradle.plugin.tasks.services
66

7-
import kotlinx.kover.gradle.plugin.dsl.*
8-
import kotlinx.kover.gradle.plugin.tools.*
7+
import kotlinx.kover.gradle.plugin.tools.CoverageTool
8+
import kotlinx.kover.gradle.plugin.tools.CoverageToolVariant
99
import org.gradle.api.DefaultTask
10-
import org.gradle.api.artifacts.*
11-
import org.gradle.api.file.*
10+
import org.gradle.api.file.ArchiveOperations
11+
import org.gradle.api.file.ConfigurableFileCollection
12+
import org.gradle.api.file.RegularFileProperty
1213
import org.gradle.api.provider.Property
1314
import org.gradle.api.tasks.*
14-
import org.gradle.kotlin.dsl.support.*
15-
import javax.inject.*
15+
import org.gradle.work.DisableCachingByDefault
16+
import javax.inject.Inject
1617

1718
/**
1819
* Task to get online instrumentation agent jar file by specified coverage tool.
1920
*
2021
* The task is cached, so in general there should not be a performance issue on large projects.
2122
*/
22-
@CacheableTask
23+
@DisableCachingByDefault(because = "Local file operations are faster then using build cache")
2324
internal abstract class KoverAgentJarTask : DefaultTask() {
2425
// relative sensitivity for file collections which are not FileTree is a comparison by file name and its contents
2526
@get:InputFiles

0 commit comments

Comments
 (0)