Fix jvmTarget was not set on reusing configuration cache.
When project has toolchain configured and on reusing configuration cache, 'filteredMapArguments' input was calculated without actual value of `jvmTarget` provided by toolchain leading to non-UP-TO-DATE KotlinCompile task state. ^KT-51937 Fixed
This commit is contained in:
+3
-1
@@ -578,7 +578,9 @@ class KotlinJavaToolchainTest : KGPBaseTest() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
build("assemble")
|
build("assemble")
|
||||||
build("assemble")
|
build("assemble") {
|
||||||
|
assertTasksUpToDate(":compileKotlin")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-4
@@ -129,10 +129,6 @@ internal abstract class DefaultKotlinJavaToolchain @Inject constructor(
|
|||||||
task: KotlinCompile,
|
task: KotlinCompile,
|
||||||
args: K2JVMCompilerArguments
|
args: K2JVMCompilerArguments
|
||||||
) {
|
) {
|
||||||
check(task.state.executing) {
|
|
||||||
"\"updateJvmTarget()\" method should be called only on task execution!"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (providedJvmExplicitlySet) {
|
if (providedJvmExplicitlySet) {
|
||||||
val jdkVersion = javaVersion.get()
|
val jdkVersion = javaVersion.get()
|
||||||
|
|
||||||
|
|||||||
+1
-4
@@ -852,10 +852,7 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
// This method could be called on configuration phase to calculate `filteredArgumentsMap` property
|
defaultKotlinJavaToolchain.get().updateJvmTarget(this, args)
|
||||||
if (state.executing) {
|
|
||||||
defaultKotlinJavaToolchain.get().updateJvmTarget(this, args)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reportingSettings().buildReportMode == BuildReportMode.VERBOSE) {
|
if (reportingSettings().buildReportMode == BuildReportMode.VERBOSE) {
|
||||||
args.reportPerf = true
|
args.reportPerf = true
|
||||||
|
|||||||
Reference in New Issue
Block a user