[Gradle] Move Kotlin daemon system properties read to build service
Instead of having a copy of those properties in each task move them into single build service Related to #KT-43605
This commit is contained in:
@@ -40,25 +40,19 @@ enum class CompilerSystemProperties(val property: String) {
|
||||
;
|
||||
|
||||
var value
|
||||
get() = systemPropertyGetter(property)
|
||||
get() = (systemPropertyGetter ?: System::getProperty)(property)
|
||||
set(value) {
|
||||
systemPropertySetter(property, value!!)
|
||||
(systemPropertySetter ?: System::setProperty)(property, value!!)
|
||||
}
|
||||
|
||||
fun clear(): String? = systemPropertyCleaner(property)
|
||||
fun clear(): String? = (systemPropertyCleaner ?: System::clearProperty)(property)
|
||||
|
||||
companion object {
|
||||
var systemPropertyGetter: (String) -> String? = {
|
||||
System.getProperty(it)
|
||||
}
|
||||
var systemPropertyGetter: ((String) -> String?)? = null
|
||||
|
||||
var systemPropertySetter: (String, String) -> String? = { key, value ->
|
||||
System.setProperty(key, value)
|
||||
}
|
||||
var systemPropertySetter: ((String, String) -> String?)? = null
|
||||
|
||||
var systemPropertyCleaner: (String) -> String? = { key ->
|
||||
System.clearProperty(key)
|
||||
}
|
||||
var systemPropertyCleaner: ((String) -> String?)? = null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user