From eb39c4c59062e569618cc9616f54ce66a4f2bc05 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 11 Oct 2017 23:08:39 +0300 Subject: [PATCH] Tests: Do not search for android-extensions-runtime in KOTLIN_PATH --- .../synthetic/test/CompilerTestUtils.kt | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/plugins/plugins-tests/tests/org/jetbrains/kotlin/android/synthetic/test/CompilerTestUtils.kt b/plugins/plugins-tests/tests/org/jetbrains/kotlin/android/synthetic/test/CompilerTestUtils.kt index c9248dcd6a4..49ebaf705b9 100755 --- a/plugins/plugins-tests/tests/org/jetbrains/kotlin/android/synthetic/test/CompilerTestUtils.kt +++ b/plugins/plugins-tests/tests/org/jetbrains/kotlin/android/synthetic/test/CompilerTestUtils.kt @@ -62,29 +62,11 @@ fun KtUsefulTestCase.createTestEnvironment(configuration: CompilerConfiguration, fun addAndroidExtensionsRuntimeLibrary(environment: KotlinCoreEnvironment) { environment.apply { - val runtimeLibrary = File(computeKotlinPaths().libPath, "android-extensions-compiler.jar") + val runtimeLibrary = File(PathUtil.kotlinPathsForCompiler.libPath, "android-extensions-compiler.jar") updateClasspath(listOf(JvmClasspathRoot(runtimeLibrary))) } } fun getResPaths(path: String): List { return File(path).listFiles { it -> it.name.startsWith("res") && it.isDirectory }!!.map { "$path${it.name}/" } -} - -val KOTLIN_HOME_PROPERTY = "kotlin.home" -val KOTLIN_HOME_ENV_VAR = "KOTLIN_HOME" - -private fun computeKotlinPaths(): KotlinPaths { - val kotlinHomeProperty = System.getProperty(KOTLIN_HOME_PROPERTY) - val kotlinHomeEnvVar = System.getenv(KOTLIN_HOME_ENV_VAR) - val kotlinHome = when { - kotlinHomeProperty != null -> File(kotlinHomeProperty) - kotlinHomeEnvVar != null -> File(kotlinHomeEnvVar) - else -> null - } - return when { - kotlinHome == null -> PathUtil.kotlinPathsForCompiler - kotlinHome.isDirectory -> KotlinPathsFromHomeDir(kotlinHome) - else -> throw RuntimeException("Kotlin home does not exist or is not a directory: " + kotlinHome) - } -} +} \ No newline at end of file