[K/N][build] Fix KT-56495: improve version manifest merge

Add missing input property to stdlib build task. This task should
consider kotlin/build version change.
Add a version check during the stdlib target task build. This check
should be done here instead of the final merge.

Fixes ^KT-56495


Merge-request: KT-MR-12906
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
This commit is contained in:
Pavel Punegov
2023-11-13 14:45:06 +00:00
committed by Space Team
parent 5c56f0ef77
commit 6053c94c8a
4 changed files with 17 additions and 1 deletions
+7
View File
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.gradle.plugin.konan.tasks.KonanCacheTask
import org.jetbrains.kotlin.konan.properties.loadProperties
import org.jetbrains.kotlin.konan.properties.saveProperties
import org.jetbrains.kotlin.konan.target.*
import org.jetbrains.kotlin.library.KLIB_PROPERTY_COMPILER_VERSION
import org.jetbrains.kotlin.library.KLIB_PROPERTY_NATIVE_TARGETS
import org.jetbrains.kotlin.konan.file.File as KFile
import org.jetbrains.kotlin.konan.target.Architecture as TargetArchitecture
@@ -18,6 +19,8 @@ val distDir: File by project
val konanHome: String by extra(distDir.absolutePath)
extra["org.jetbrains.kotlin.native.home"] = konanHome
val kotlinVersion: String by rootProject.extra
plugins {
id("compile-to-bitcode")
id("runtime-testing")
@@ -600,6 +603,10 @@ targetList.forEach { targetName ->
with(KFile(destinationDir.resolve("default/manifest").absolutePath)) {
val props = loadProperties()
props[KLIB_PROPERTY_NATIVE_TARGETS] = targetName
val version = props[KLIB_PROPERTY_COMPILER_VERSION]
check(version == kotlinVersion) {
"Manifest file ($this) processing: $version was found while $kotlinVersion was expected"
}
saveProperties(props)
}
}