Reuse repository selection logic in KotlinMavenConfigurator
This commit is contained in:
+4
-11
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user