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

Fix KobaltSettings.

This commit is contained in:
Cedric Beust 2016-04-01 22:41:18 -07:00
parent c6f9c88d2a
commit 453097240b
5 changed files with 9 additions and 20 deletions

View file

@ -15,7 +15,6 @@ import com.google.inject.Provider
import com.google.inject.Singleton
import com.google.inject.TypeLiteral
import com.google.inject.assistedinject.FactoryModuleBuilder
import java.io.File
import java.util.concurrent.ExecutorService
public open class MainModule(val args: Args, val settings: KobaltSettings) : AbstractModule() {
@ -52,7 +51,7 @@ public open class MainModule(val args: Args, val settings: KobaltSettings) : Abs
bind(KobaltSettings::class.java).toProvider(Provider<KobaltSettings> {
settings
}).`in`(Singleton::class.java)
bind(Aether::class.java).toInstance(Aether(File(settings.localRepo)))
bind(Aether::class.java).toInstance(Aether(settings.localRepo))
// bindListener(Matchers.any(), object: TypeListener {
// override fun <I> hear(typeLiteral: TypeLiteral<I>?, typeEncounter: TypeEncounter<I>?) {

View file

@ -8,13 +8,12 @@ import com.google.inject.Scopes
import java.io.File
val TEST_KOBALT_SETTINGS = KobaltSettings(KobaltSettingsXml()).apply {
localRepo = SystemProperties.homeDir + File.separatorChar + "" +
".kobalt-test"
localRepo = File(SystemProperties.homeDir + File.separatorChar + ".kobalt-test")
}
class TestLocalRepo: LocalRepo(TEST_KOBALT_SETTINGS)
public class TestModule : MainModule(Args(), TEST_KOBALT_SETTINGS) {
class TestModule : MainModule(Args(), TEST_KOBALT_SETTINGS) {
override fun configureTest() {
bind(LocalRepo::class.java).to(TestLocalRepo::class.java).`in`(Scopes.SINGLETON)
}