From 3f056bc086df0b5ed7f8683906c130f25d9a1fd4 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Tue, 28 Dec 2021 17:18:37 +0300 Subject: [PATCH] [Native][tests] Gradle property kotlin.internal.native.test.compilerClasspath: when not specified compute the default value based on kotlin.internal.native.test.nativeHome property, or fallback to JAR artifact of :kotlin-native-compiler-embeddable project when kotlin.internal.native.test.nativeHome not specified. --- native/native.tests/build.gradle.kts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/native/native.tests/build.gradle.kts b/native/native.tests/build.gradle.kts index a6c6abd6969..63bdf1ccbc6 100644 --- a/native/native.tests/build.gradle.kts +++ b/native/native.tests/build.gradle.kts @@ -101,9 +101,14 @@ fun blackBoxTest(taskName: String, vararg tags: String) = projectTest(taskName, } TestProperty.COMPILER_CLASSPATH.setUpFromGradleProperty(this) { - val kotlinNativeCompilerEmbeddable = configurations.detachedConfiguration(dependencies.project(":kotlin-native-compiler-embeddable")) - dependsOn(kotlinNativeCompilerEmbeddable) - kotlinNativeCompilerEmbeddable.files.joinToString(";") + val customNativeHome = TestProperty.KOTLIN_NATIVE_HOME.readGradleProperty(this) + if (customNativeHome != null) { + file(customNativeHome).resolve("konan/lib/kotlin-native-compiler-embeddable.jar").absolutePath + } else { + val kotlinNativeCompilerEmbeddable = configurations.detachedConfiguration(dependencies.project(":kotlin-native-compiler-embeddable")) + dependsOn(kotlinNativeCompilerEmbeddable) + kotlinNativeCompilerEmbeddable.files.joinToString(";") + } } // Pass Gradle properties as JVM properties so test process can read them.