1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00

Make these lazy.

This commit is contained in:
Cedric Beust 2016-03-23 15:32:15 +04:00
parent 86e05dd17b
commit 930caf73bf

View file

@ -8,7 +8,7 @@ import java.io.InputStream
import java.time.Duration import java.time.Duration
import java.util.* import java.util.*
public class Kobalt { class Kobalt {
companion object { companion object {
// This injector will eventually be replaced with a different injector initialized with the // This injector will eventually be replaced with a different injector initialized with the
// correct arguments (or with a TestModule) but it's necessary to give it a default value // correct arguments (or with a TestModule) but it's necessary to give it a default value
@ -83,10 +83,12 @@ public class Kobalt {
properties.forEach { es -> System.setProperty(es.key.toString(), es.value.toString()) } properties.forEach { es -> System.setProperty(es.key.toString(), es.value.toString()) }
} }
val version = kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION) val version: String
get() = kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION)
// Note: Duration is Java 8 only, might need an alternative if we want to support Java < 8 // Note: Duration is Java 8 only, might need an alternative if we want to support Java < 8
val versionCheckTimeout = Duration.parse( val versionCheckTimeout: Duration
kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION_CHECK_TIMEOUT) ?: "P1D") get() = Duration.parse( kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION_CHECK_TIMEOUT) ?: "P1D")
fun findPlugin(name: String) = Plugins.findPlugin(name) fun findPlugin(name: String) = Plugins.findPlugin(name)
} }