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)
|
pom.addDependency(MavenId("junit", "junit", "4.12"), MavenArtifactScope.TEST, null, false, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSnapshot(version)) {
|
val repositoryDescription = getRepositoryForVersion(version)
|
||||||
pom.addLibraryRepository(SNAPSHOT_REPOSITORY)
|
if (repositoryDescription != null) {
|
||||||
pom.addPluginRepository(SNAPSHOT_REPOSITORY)
|
pom.addLibraryRepository(repositoryDescription)
|
||||||
}
|
pom.addPluginRepository(repositoryDescription)
|
||||||
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 plugin = pom.addPlugin(MavenId(GROUP_ID, MAVEN_PLUGIN_ID, "\${$KOTLIN_VERSION_PROPERTY}"))
|
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)
|
data class RepositoryDescription(val id: String, val name: String, val url: String, val bintrayUrl: String?, val isSnapshot: Boolean)
|
||||||
|
|
||||||
@JvmField
|
|
||||||
val SNAPSHOT_REPOSITORY = RepositoryDescription(
|
val SNAPSHOT_REPOSITORY = RepositoryDescription(
|
||||||
"sonatype.oss.snapshots",
|
"sonatype.oss.snapshots",
|
||||||
"Sonatype OSS Snapshot Repository",
|
"Sonatype OSS Snapshot Repository",
|
||||||
@@ -45,7 +44,6 @@ val SNAPSHOT_REPOSITORY = RepositoryDescription(
|
|||||||
null,
|
null,
|
||||||
isSnapshot = true)
|
isSnapshot = true)
|
||||||
|
|
||||||
@JvmField
|
|
||||||
val EAP_REPOSITORY = RepositoryDescription(
|
val EAP_REPOSITORY = RepositoryDescription(
|
||||||
"bintray.kotlin.eap",
|
"bintray.kotlin.eap",
|
||||||
"Bintray Kotlin EAP Repository",
|
"Bintray Kotlin EAP Repository",
|
||||||
@@ -53,7 +51,6 @@ val EAP_REPOSITORY = RepositoryDescription(
|
|||||||
"https://bintray.com/kotlin/kotlin-eap/kotlin/",
|
"https://bintray.com/kotlin/kotlin-eap/kotlin/",
|
||||||
isSnapshot = false)
|
isSnapshot = false)
|
||||||
|
|
||||||
@JvmField
|
|
||||||
val EAP_11_REPOSITORY = RepositoryDescription(
|
val EAP_11_REPOSITORY = RepositoryDescription(
|
||||||
"bintray.kotlin.eap",
|
"bintray.kotlin.eap",
|
||||||
"Bintray Kotlin 1.1 EAP Repository",
|
"Bintray Kotlin 1.1 EAP Repository",
|
||||||
|
|||||||
Reference in New Issue
Block a user