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

Make Kobalt reentrant.

This commit is contained in:
Cedric Beust 2016-04-25 02:04:17 -08:00
parent fdcca3a1aa
commit bace815481
7 changed files with 228 additions and 36 deletions

View file

@ -26,6 +26,10 @@ class Args {
"actually running them")
var dryRun: Boolean = false
@Parameter(names = arrayOf("--force"), description = "Force a new server to be launched even if another one" +
" is already running")
var force: Boolean = false
@Parameter(names = arrayOf("--gc"), description = "Delete old files")
var gc: Boolean = false

View file

@ -6,6 +6,9 @@ import com.beust.kobalt.Plugins
import com.beust.kobalt.ProxyConfig
import com.google.inject.Injector
import org.eclipse.aether.repository.Proxy
import com.beust.kobalt.internal.PluginInfo
import com.google.inject.Guice
import com.google.inject.Module
import java.io.InputStream
import java.net.InetSocketAddress
import java.time.Duration
@ -15,6 +18,18 @@ class Kobalt {
companion object {
lateinit var INJECTOR : Injector
fun init(module: Module) {
Kobalt.INJECTOR = Guice.createInjector(module)
//
// Add all the plugins read in kobalt-plugin.xml to the Plugins singleton, so that code
// in the build file that calls Plugins.findPlugin() can find them (code in the
// build file do not have access to the KobaltContext).
//
val pluginInfo = Kobalt.INJECTOR.getInstance(PluginInfo::class.java)
pluginInfo.plugins.forEach { Plugins.addPluginInstance(it) }
}
var context: KobaltContext? = null
val proxyConfig = with(Kobalt.context?.settings?.proxy) {