Don't generate references to eap-1.1 and eap-1.2 repositories

Now all Kotlin EAP releases are published only to kotlin-eap on Bintray
This commit is contained in:
Dmitry Jemerov
2018-01-10 12:02:54 +01:00
parent 5ffd6a737e
commit 99a9634609
2 changed files with 2 additions and 75 deletions
@@ -1,17 +1,6 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.configuration
@@ -68,20 +57,6 @@ val EAP_REPOSITORY = RepositoryDescription(
"https://bintray.com/kotlin/kotlin-eap/kotlin/",
isSnapshot = false)
val EAP_11_REPOSITORY = RepositoryDescription(
"bintray.kotlin.eap",
"Bintray Kotlin 1.1 EAP Repository",
"http://dl.bintray.com/kotlin/kotlin-eap-1.1",
"https://bintray.com/kotlin/kotlin-eap-1.1/kotlin/",
isSnapshot = false)
val EAP_12_REPOSITORY = RepositoryDescription(
"bintray.kotlin.eap",
"Bintray Kotlin 1.2 EAP Repository",
"http://dl.bintray.com/kotlin/kotlin-eap-1.2",
"https://bintray.com/kotlin/kotlin-eap-1.2/kotlin/",
isSnapshot = false)
val MAVEN_CENTRAL = "mavenCentral()"
val JCENTER = "jcenter()"
@@ -106,8 +81,6 @@ fun RepositoryDescription.toKotlinRepositorySnippet() = "maven {\n setUrl(\"$
fun getRepositoryForVersion(version: String): RepositoryDescription? = when {
isSnapshot(version) -> SNAPSHOT_REPOSITORY
useEapRepository(2, version) -> EAP_12_REPOSITORY
useEapRepository(1, version) -> EAP_11_REPOSITORY
isEap(version) -> EAP_REPOSITORY
else -> null
}
@@ -262,11 +235,6 @@ fun isEap(version: String): Boolean {
return version.contains("rc") || version.contains("eap")
}
fun useEapRepository(minorKotlinVersion: Int, version: String): Boolean {
return Regex("1\\.$minorKotlinVersion(\\.\\d\\d?)?-[A-Za-z][A-Za-z0-9-]*").matches(version) &&
!version.startsWith("1.$minorKotlinVersion.0-dev")
}
private class LibraryKindSearchScope(val module: Module,
val baseScope: GlobalSearchScope,
val libraryKind: PersistentLibraryKind<*>
@@ -1,41 +0,0 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.configuration
import com.intellij.testFramework.UsefulTestCase
import org.junit.Assert
class ConfigureKotlinUtilTest : UsefulTestCase() {
fun testEapRepository() {
Assert.assertTrue(useEapRepository(1, "1.1-M04"))
Assert.assertTrue(useEapRepository(1, "1.1-beta"))
Assert.assertTrue(useEapRepository(1, "1.1.0-beta"))
Assert.assertTrue(useEapRepository(1, "1.1-beta-2"))
Assert.assertTrue(useEapRepository(1, "1.1-rc2"))
Assert.assertTrue(useEapRepository(1, "1.1.0-RC"))
Assert.assertTrue(useEapRepository(1, "1.1.1-eap-22"))
Assert.assertFalse(useEapRepository(1, "1.1"))
Assert.assertFalse(useEapRepository(1, "1.1.2"))
Assert.assertFalse(useEapRepository(1, "1.1.2-3"))
Assert.assertFalse(useEapRepository(1, "1.1.0-dev-1234"))
Assert.assertTrue(useEapRepository(1, "1.1.50-eap-28"))
Assert.assertFalse(useEapRepository(1, "1.1.50"))
Assert.assertTrue(useEapRepository(2, "1.2-M01"))
Assert.assertTrue(useEapRepository(2, "1.2-M1"))
Assert.assertFalse(useEapRepository(2, "1.2"))
}
}