Skip to content

Commit 85c5881

Browse files
authored
Fix issue with identical cache keys between projects
Fixes #633 PR #636
1 parent f8d3b5e commit 85c5881

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

kover-gradle-plugin/src/functionalTest/kotlin/kotlinx/kover/gradle/plugin/test/functional/cases/ArtifactGenerationTests.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ internal class ArtifactGenerationTests {
2525
}
2626
}
2727

28+
/**
29+
* Kover generation tasks compute a cache key based on the content of the relative paths
30+
* in their input field. If there are no additional inputs defiend that differentiate task input
31+
* between projects then the cache key of the generate tasks in one project is the same as the cache key
32+
* in other projects.
33+
*/
34+
@GeneratedTest
35+
fun BuildConfigurator.testBuildCacheEntriesAreNotReusedAmongEmptyProjects() {
36+
addProjectWithKover { }
37+
addProjectWithKover(":project-a", "project-a") {}
38+
addProjectWithKover(":project-b", "project-b") {}
39+
run("check", "--build-cache") {}
40+
}
41+
2842
/**
2943
* Check that Kover artifact files are not resolved during the task dependency tree construction process.
3044
*

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ internal abstract class KoverArtifactGenerationTask : DefaultTask() {
4242

4343
private val rootDir: File = project.rootDir
4444

45-
private val projectPath: String = project.path
45+
@get:Input
46+
internal val projectPath: String = project.path
4647

4748
@TaskAction
4849
fun generate() {

0 commit comments

Comments
 (0)