[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.

This commit is contained in:
Dmitriy Dolovov
2021-12-28 17:18:37 +03:00
parent 52c1a339c4
commit 3f056bc086
+5
View File
@@ -101,10 +101,15 @@ fun blackBoxTest(taskName: String, vararg tags: String) = projectTest(taskName,
} }
TestProperty.COMPILER_CLASSPATH.setUpFromGradleProperty(this) { TestProperty.COMPILER_CLASSPATH.setUpFromGradleProperty(this) {
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")) val kotlinNativeCompilerEmbeddable = configurations.detachedConfiguration(dependencies.project(":kotlin-native-compiler-embeddable"))
dependsOn(kotlinNativeCompilerEmbeddable) dependsOn(kotlinNativeCompilerEmbeddable)
kotlinNativeCompilerEmbeddable.files.joinToString(";") kotlinNativeCompilerEmbeddable.files.joinToString(";")
} }
}
// Pass Gradle properties as JVM properties so test process can read them. // Pass Gradle properties as JVM properties so test process can read them.
TestProperty.TEST_TARGET.setUpFromGradleProperty(this) TestProperty.TEST_TARGET.setUpFromGradleProperty(this)