Skip to content

Commit

Permalink
Fix issue with identical cache keys between projects
Browse files Browse the repository at this point in the history
Fixes #633
PR #636
  • Loading branch information
remcomokveld authored Jun 18, 2024
1 parent f8d3b5e commit 85c5881
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ internal class ArtifactGenerationTests {
}
}

/**
* Kover generation tasks compute a cache key based on the content of the relative paths
* in their input field. If there are no additional inputs defiend that differentiate task input
* between projects then the cache key of the generate tasks in one project is the same as the cache key
* in other projects.
*/
@GeneratedTest
fun BuildConfigurator.testBuildCacheEntriesAreNotReusedAmongEmptyProjects() {
addProjectWithKover { }
addProjectWithKover(":project-a", "project-a") {}
addProjectWithKover(":project-b", "project-b") {}
run("check", "--build-cache") {}
}

/**
* Check that Kover artifact files are not resolved during the task dependency tree construction process.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ internal abstract class KoverArtifactGenerationTask : DefaultTask() {

private val rootDir: File = project.rootDir

private val projectPath: String = project.path
@get:Input
internal val projectPath: String = project.path

@TaskAction
fun generate() {
Expand Down

0 comments on commit 85c5881

Please sign in to comment.