Reuse repository selection logic in KotlinMavenConfigurator

This commit is contained in:
Dmitry Jemerov
2017-04-19 12:45:52 +02:00
parent f575e2710f
commit d3682025cb
2 changed files with 4 additions and 14 deletions
@@ -151,17 +151,10 @@ abstract class KotlinMavenConfigurator
pom.addDependency(MavenId("junit", "junit", "4.12"), MavenArtifactScope.TEST, null, false, null)
}
if (isSnapshot(version)) {
pom.addLibraryRepository(SNAPSHOT_REPOSITORY)
pom.addPluginRepository(SNAPSHOT_REPOSITORY)
}
else if (useEap11Repository(version)) {
pom.addLibraryRepository(EAP_11_REPOSITORY)
pom.addPluginRepository(EAP_11_REPOSITORY)
}
else if (isEap(version)) {
pom.addLibraryRepository(EAP_REPOSITORY)
pom.addPluginRepository(EAP_REPOSITORY)
val repositoryDescription = getRepositoryForVersion(version)
if (repositoryDescription != null) {
pom.addLibraryRepository(repositoryDescription)
pom.addPluginRepository(repositoryDescription)
}
val plugin = pom.addPlugin(MavenId(GROUP_ID, MAVEN_PLUGIN_ID, "\${$KOTLIN_VERSION_PROPERTY}"))
@@ -37,7 +37,6 @@ import org.jetbrains.kotlin.utils.ifEmpty
data class RepositoryDescription(val id: String, val name: String, val url: String, val bintrayUrl: String?, val isSnapshot: Boolean)
@JvmField
val SNAPSHOT_REPOSITORY = RepositoryDescription(
"sonatype.oss.snapshots",
"Sonatype OSS Snapshot Repository",
@@ -45,7 +44,6 @@ val SNAPSHOT_REPOSITORY = RepositoryDescription(
null,
isSnapshot = true)
@JvmField
val EAP_REPOSITORY = RepositoryDescription(
"bintray.kotlin.eap",
"Bintray Kotlin EAP Repository",
@@ -53,7 +51,6 @@ val EAP_REPOSITORY = RepositoryDescription(
"https://bintray.com/kotlin/kotlin-eap/kotlin/",
isSnapshot = false)
@JvmField
val EAP_11_REPOSITORY = RepositoryDescription(
"bintray.kotlin.eap",
"Bintray Kotlin 1.1 EAP Repository",