From 635288ec851e6f1ea63677f328854fd2f17f891c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 20 Oct 2017 12:11:09 +0300 Subject: [PATCH] [compiletest]: use common infrastructure to detect the host OS --- backend.native/compiletest/build.gradle | 1 + .../org/jetbrains/kotlin/compiletest/DistProperties.kt | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend.native/compiletest/build.gradle b/backend.native/compiletest/build.gradle index b81357faf5c..6f3adac9a2e 100644 --- a/backend.native/compiletest/build.gradle +++ b/backend.native/compiletest/build.gradle @@ -4,6 +4,7 @@ apply plugin: 'kotlin' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile project(path: ':backend.native', configuration: 'cli_bc') + compile project(':shared') testCompile 'junit:junit:4.12' } diff --git a/backend.native/compiletest/src/main/kotlin/org/jetbrains/kotlin/compiletest/DistProperties.kt b/backend.native/compiletest/src/main/kotlin/org/jetbrains/kotlin/compiletest/DistProperties.kt index c3d9f1fbdbb..1c02c151370 100644 --- a/backend.native/compiletest/src/main/kotlin/org/jetbrains/kotlin/compiletest/DistProperties.kt +++ b/backend.native/compiletest/src/main/kotlin/org/jetbrains/kotlin/compiletest/DistProperties.kt @@ -1,14 +1,14 @@ package org.jetbrains.kotlin.compiletest +import org.jetbrains.kotlin.konan.target.Family +import org.jetbrains.kotlin.konan.target.TargetManager import java.nio.file.Path import java.nio.file.Paths object DistProperties { - private val isWindows: Boolean = requireProp("os.name").startsWith("Windows") - private val dist: Path = Paths.get(requireProp("konan.home")) - private val konancDriver = if (isWindows) "konanc.bat" else "konanc" + private val konancDriver = if (TargetManager.host.family == Family.WINDOWS) "konanc.bat" else "konanc" val konanc: Path = dist.resolve("bin/$konancDriver") val lldb: Path = Paths.get("lldb")