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

settings.xml now uses camel case tags.

This commit is contained in:
Cedric Beust 2016-07-20 22:46:00 -08:00
parent 29dc3dd466
commit 8a30679966
5 changed files with 13 additions and 13 deletions

View file

@ -15,24 +15,24 @@ import javax.xml.bind.annotation.XmlRootElement
/**
* The root element of kobalt-settings.xml
*/
@XmlRootElement(name = "kobalt-settings")
@XmlRootElement(name = "kobaltSettings")
class KobaltSettingsXml {
@XmlElement(name = "local-repo") @JvmField
var localRepo: String = homeDir(KFiles.KOBALT_DOT_DIR, "repository")
@XmlElement(name = "localCache") @JvmField
var localCache: String = homeDir(KFiles.KOBALT_DOT_DIR, "repository")
@XmlElement(name = "local-maven-repo") @JvmField
@XmlElement(name = "localMavenRepo") @JvmField
var localMavenRepo: String = homeDir(KFiles.KOBALT_DOT_DIR, "localMavenRepo")
@XmlElement(name = "default-repos") @JvmField
@XmlElement(name = "defaulRepos") @JvmField
var defaultRepos: DefaultReposXml? = null
@XmlElement(name = "proxies") @JvmField
var proxies: ProxiesXml? = null
@XmlElement(name = "kobalt-compiler-version") @JvmField
@XmlElement(name = "kobaltCompilerVersion") @JvmField
var kobaltCompilerVersion: String = "1.0.3"
@XmlElement(name = "kobalt-compiler-repo") @JvmField
@XmlElement(name = "kobaltCompilerRepo") @JvmField
var kobaltCompilerRepo: String? = null
}
@ -70,10 +70,10 @@ class KobaltSettings @Inject constructor(val xmlFile: KobaltSettingsXml) {
/**
* Location of the cache repository.
*/
var localRepo = KFiles.makeDir(xmlFile.localRepo) // var for testing
var localCache = KFiles.makeDir(xmlFile.localCache) // var for testing
/**
* Location of the local Maven repo for the task deployToLocalMaven
* Location of the local Maven repo for the task "publishToLocalMaven".
*/
val localMavenRepo = KFiles.makeDir(xmlFile.localMavenRepo)

View file

@ -11,7 +11,7 @@ import javax.inject.Singleton
@Singleton
open class LocalRepo @Inject constructor(val kobaltSettings: KobaltSettings) {
val localRepo: File
get() = kobaltSettings.localRepo
get() = kobaltSettings.localCache
fun existsPom(d: LocalDep, v: String) : Boolean {
return File(d.toAbsolutePomFile(v)).exists()

View file

@ -37,7 +37,7 @@ import java.util.concurrent.Future
class DependencyResult(val dependency: IClasspathDependency, val repoUrl: String)
class KobaltAether @Inject constructor (val settings: KobaltSettings, val aether: Aether) {
val localRepo: File get() = settings.localRepo
val localRepo: File get() = settings.localCache
/**
* Create an IClasspathDependency from a Kobalt id.

View file

@ -52,7 +52,7 @@ open class MainModule(val args: Args, val settings: KobaltSettings) : AbstractMo
})
EventBus().let { eventBus ->
bind(EventBus::class.java).toInstance(eventBus)
bind(Aether::class.java).toInstance(Aether(settings.localRepo, settings, eventBus))
bind(Aether::class.java).toInstance(Aether(settings.localCache, settings, eventBus))
}
bind(PluginInfo::class.java).toProvider(Provider<PluginInfo> {
PluginInfo.readKobaltPluginXml()

View file

@ -8,7 +8,7 @@ import com.google.inject.Scopes
import java.io.File
val TEST_KOBALT_SETTINGS = KobaltSettings(KobaltSettingsXml()).apply {
localRepo = File(SystemProperties.homeDir + File.separatorChar + ".kobalt-test")
localCache = File(SystemProperties.homeDir + File.separatorChar + ".kobalt-test")
}
class TestLocalRepo: LocalRepo(TEST_KOBALT_SETTINGS)