Skip to content

Commit

Permalink
[KGP] Fix missing task dependency between Test and Main compilations
Browse files Browse the repository at this point in the history
For historic reasons friendPaths might contain the jars built from the
main module. However it's an Internal field, so task dependency wasn't
created.

This commit completes the chain of providers. As a result Gradle can
deduce that :compileKotlinTest depends on :desktopJar, if applicable.

^KT-69330 Fixed
  • Loading branch information
mazhukinevgeniy authored and qodana-bot committed Jul 8, 2024
1 parent 1f70ebb commit 623edef
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> @Inject constr

// This allows us to treat friendPaths as Input rather than InputFiles
@get:Input
internal val friendPathsSet: Set<String>
internal val friendPathsSet: Provider<Set<String>>
get() {
val buildDirFile = projectLayout.buildDirectory.asFile.get()
return friendPaths
.filter { it.exists() }
.map { it.normalize().relativeTo(buildDirFile).invariantSeparatorsPath }.toSet()
return friendPaths.elements.map { providedSet ->
providedSet
.map { it.asFile }
.filter { it.exists() }
.map { it.normalize().relativeTo(buildDirFile).invariantSeparatorsPath }
.toSet()
}
}

@get:Internal
Expand Down

0 comments on commit 623edef

Please sign in to comment.