[Gradle] Read more system properties through Gradle providers
Related to #KT-43605
This commit is contained in:
+4
-3
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.daemon.common
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||
import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly
|
||||
import java.io.File
|
||||
|
||||
@@ -26,7 +27,7 @@ enum class OSKind {
|
||||
Unknown;
|
||||
|
||||
companion object {
|
||||
val current: OSKind = System.getProperty("os.name").toLowerCaseAsciiOnly().let {
|
||||
val current: OSKind = CompilerSystemProperties.OS_NAME.safeValue.toLowerCaseAsciiOnly().let {
|
||||
when {
|
||||
// partly taken from http://www.code4copy.com/java/post/detecting-os-type-in-java
|
||||
it.startsWith("windows") -> Windows
|
||||
@@ -57,8 +58,8 @@ private fun String?.orDefault(v: String): String =
|
||||
|
||||
object FileSystem {
|
||||
|
||||
val userHomePath: String get() = System.getProperty("user.home")
|
||||
val tempPath: String get() = System.getProperty("java.io.tmpdir")
|
||||
val userHomePath: String get() = CompilerSystemProperties.USER_HOME.safeValue
|
||||
val tempPath: String get() = CompilerSystemProperties.TMP_DIR.safeValue
|
||||
|
||||
val logFilesPath: String get() = tempPath
|
||||
|
||||
|
||||
Reference in New Issue
Block a user