From 8a306799664345bfb08dcad2e0a6c1076873f8f0 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Wed, 20 Jul 2016 22:46:00 -0800 Subject: [PATCH] settings.xml now uses camel case tags. --- .../beust/kobalt/internal/KobaltSettingsXml.kt | 18 +++++++++--------- .../kotlin/com/beust/kobalt/maven/LocalRepo.kt | 2 +- .../com/beust/kobalt/maven/aether/Aether.kt | 2 +- .../kotlin/com/beust/kobalt/app/MainModule.kt | 2 +- src/test/kotlin/com/beust/kobalt/TestModule.kt | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/KobaltSettingsXml.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/KobaltSettingsXml.kt index 8991abbf..75394d54 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/KobaltSettingsXml.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/KobaltSettingsXml.kt @@ -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) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt index 5077d5b9..21d36172 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt @@ -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() diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt index 1df36991..192f1908 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/aether/Aether.kt @@ -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. diff --git a/src/main/kotlin/com/beust/kobalt/app/MainModule.kt b/src/main/kotlin/com/beust/kobalt/app/MainModule.kt index 9a7302d5..26d91453 100644 --- a/src/main/kotlin/com/beust/kobalt/app/MainModule.kt +++ b/src/main/kotlin/com/beust/kobalt/app/MainModule.kt @@ -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.readKobaltPluginXml() diff --git a/src/test/kotlin/com/beust/kobalt/TestModule.kt b/src/test/kotlin/com/beust/kobalt/TestModule.kt index 113a41e4..b681205d 100644 --- a/src/test/kotlin/com/beust/kobalt/TestModule.kt +++ b/src/test/kotlin/com/beust/kobalt/TestModule.kt @@ -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)