Skip to content

Commit 623edef

Browse files
mazhukinevgeniySpace Team
authored and
Space Team
committed
[KGP] Fix missing task dependency between Test and Main compilations
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
1 parent 1f70ebb commit 623edef

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/AbstractKotlinCompile.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,16 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> @Inject constr
104104

105105
// This allows us to treat friendPaths as Input rather than InputFiles
106106
@get:Input
107-
internal val friendPathsSet: Set<String>
107+
internal val friendPathsSet: Provider<Set<String>>
108108
get() {
109109
val buildDirFile = projectLayout.buildDirectory.asFile.get()
110-
return friendPaths
111-
.filter { it.exists() }
112-
.map { it.normalize().relativeTo(buildDirFile).invariantSeparatorsPath }.toSet()
110+
return friendPaths.elements.map { providedSet ->
111+
providedSet
112+
.map { it.asFile }
113+
.filter { it.exists() }
114+
.map { it.normalize().relativeTo(buildDirFile).invariantSeparatorsPath }
115+
.toSet()
116+
}
113117
}
114118

115119
@get:Internal

0 commit comments

Comments
 (0)