From 99a963460956c641a58fab1a0c1daf9e4f321d2e Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 10 Jan 2018 12:02:54 +0100 Subject: [PATCH] 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 --- .../ConfigureKotlinInProjectUtils.kt | 36 +--------------- .../configuration/ConfigureKotlinUtilTest.kt | 41 ------------------- 2 files changed, 2 insertions(+), 75 deletions(-) delete mode 100644 idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinUtilTest.kt diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt index e7e2daced4c..8e184320d61 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt @@ -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<*> diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinUtilTest.kt b/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinUtilTest.kt deleted file mode 100644 index fd31b9fa9d8..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinUtilTest.kt +++ /dev/null @@ -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")) - } -} \ No newline at end of file