[Gradle IT] Fixed prepareNativeBundleForGradleIT with k/n disabled

#KT-45978
This commit is contained in:
Dmitrii Krasnov
2023-10-26 12:51:10 +02:00
committed by Space Team
parent e18a2d0a2e
commit 45a1cc1a4a
@@ -150,37 +150,39 @@ tasks.register<Delete>("cleanUserHomeKonanDir") {
tasks.register<Copy>("prepareNativeBundleForGradleIT") { tasks.register<Copy>("prepareNativeBundleForGradleIT") {
description = "This task adds depenecy on :kotlin-native:bundle and then copying built bundle into the tests' konan dir" description = "This task adds dependency on :kotlin-native:bundle and then copying built bundle into the tests' konan dir"
// 1. Build full Kotlin Native bundle if (project.kotlinBuildProperties.isKotlinNativeEnabled) {
dependsOn(":kotlin-native:bundle") // 1. Build full Kotlin Native bundle
dependsOn(":kotlin-native:bundle")
// 2. Coping and extracting k/n artifacts from the 1st step to tests' konan data directory // 2. Coping and extracting k/n artifacts from the 1st step to tests' konan data directory
val (extension, unzipFunction) = when (HostManager.host) { val (extension, unzipFunction) = when (HostManager.host) {
KonanTarget.MINGW_X64 -> Pair("zip", ::zipTree) KonanTarget.MINGW_X64 -> Pair("zip", ::zipTree)
else -> Pair("tar.gz", ::tarTree) else -> Pair("tar.gz", ::tarTree)
} }
val kotlinNativeRootDir = rootProject.findProject(":kotlin-native")?.projectDir val kotlinNativeRootDir = rootProject.findProject(":kotlin-native")?.projectDir
?: throw IllegalStateException("The path to kotlin-native module is undefined.") ?: throw IllegalStateException("The path to kotlin-native module is undefined.")
from( from(
unzipFunction( unzipFunction(
kotlinNativeRootDir.resolve("kotlin-native-${HostManager.platformName()}-${project.kotlinBuildProperties.defaultSnapshotVersion}.$extension") kotlinNativeRootDir.resolve("kotlin-native-${HostManager.platformName()}-${project.kotlinBuildProperties.defaultSnapshotVersion}.$extension")
)
) )
) from(
from( unzipFunction(
unzipFunction( kotlinNativeRootDir.resolve("kotlin-native-prebuilt-${HostManager.platformName()}-${project.kotlinBuildProperties.defaultSnapshotVersion}.$extension")
kotlinNativeRootDir.resolve("kotlin-native-prebuilt-${HostManager.platformName()}-${project.kotlinBuildProperties.defaultSnapshotVersion}.$extension") )
) )
)
into( into(
konanDataDir konanDataDir
) )
doFirst { doFirst {
delete(konanDataDir) delete(konanDataDir)
}
} }
} }