All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.org.jetbrains.skiko.OsArch.jvm.kt Maven / Gradle / Ivy

There is a newer version: 0.6.7
Show newest version
package org.jetbrains.skiko

actual val hostOs: OS by lazy {
    val osName = System.getProperty("os.name")
    when {
        osName == "Mac OS X" -> OS.MacOS
        osName == "Linux" -> OS.Linux
        osName.startsWith("Win") -> OS.Windows
        else -> throw Error("Unknown OS $osName")
    }
}

actual val hostArch: Arch by lazy {
    val osArch = System.getProperty("os.arch")
    when (osArch) {
        "x86_64", "amd64" -> Arch.X64
        "aarch64" -> Arch.Arm64
        else -> throw Error("Unknown arch $osArch")
    }
}

actual val hostId by lazy {
    "${hostOs.id}-${hostArch.id}"
}

internal val hostFullName by lazy {
    "${System.getProperty("os.name")}, ${System.getProperty("os.version")}, ${hostArch.id}"
}

internal val javaVendor by lazy {
    "${System.getProperty("java.vendor")} ${System.getProperty("java.version")}"
}

internal val javaLocation by lazy {
    "${System.getProperty("java.home")}"
}

actual val kotlinBackend: KotlinBackend
    get() = KotlinBackend.JVM




© 2015 - 2024 Weber Informatics LLC | Privacy Policy