mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
added versionCheckTimeout
to Kobalt
added `kobalt.version.check_timeout` to `kobalt.properties` Uses ISO-8601 period format
This commit is contained in:
parent
0fe76cd31d
commit
789918a7ab
2 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,7 @@ import com.beust.kobalt.HostConfig
|
||||||
import com.beust.kobalt.Plugins
|
import com.beust.kobalt.Plugins
|
||||||
import com.google.inject.Injector
|
import com.google.inject.Injector
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
import java.time.Duration
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
public class Kobalt {
|
public class Kobalt {
|
||||||
|
@ -34,8 +35,9 @@ public class Kobalt {
|
||||||
if (repo.url.endsWith("/")) repo
|
if (repo.url.endsWith("/")) repo
|
||||||
else repo.copy(url = (repo.url + "/")))
|
else repo.copy(url = (repo.url + "/")))
|
||||||
|
|
||||||
private val PROPERTY_KOBALT_VERSION = "kobalt.version"
|
|
||||||
private val KOBALT_PROPERTIES = "kobalt.properties"
|
private val KOBALT_PROPERTIES = "kobalt.properties"
|
||||||
|
private val PROPERTY_KOBALT_VERSION = "kobalt.version"
|
||||||
|
private val PROPERTY_KOBALT_VERSION_CHECK_TIMEOUT = "kobalt.version.check_timeout" // ISO-8601
|
||||||
|
|
||||||
/** kobalt.properties */
|
/** kobalt.properties */
|
||||||
private val kobaltProperties: Properties by lazy { readProperties() }
|
private val kobaltProperties: Properties by lazy { readProperties() }
|
||||||
|
@ -73,6 +75,7 @@ public class Kobalt {
|
||||||
}
|
}
|
||||||
|
|
||||||
val version = kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION)
|
val version = kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION)
|
||||||
|
val versionCheckTimeout = Duration.parse(kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION_CHECK_TIMEOUT))
|
||||||
|
|
||||||
fun findPlugin(name: String) = Plugins.findPlugin(name)
|
fun findPlugin(name: String) = Plugins.findPlugin(name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
kobalt.version=0.401
|
kobalt.version=0.401
|
||||||
|
kobalt.version.check_timeout=P1DT2H
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue