Generify Gradle importing tests so they can be used in the Ultimate repo
This commit is contained in:
+3
-3
@@ -9,7 +9,7 @@ import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
|
|||||||
import com.intellij.openapi.module.ModuleManager
|
import com.intellij.openapi.module.ModuleManager
|
||||||
import com.intellij.openapi.roots.*
|
import com.intellij.openapi.roots.*
|
||||||
import com.intellij.openapi.roots.impl.ModulesOrderEnumerator
|
import com.intellij.openapi.roots.impl.ModulesOrderEnumerator
|
||||||
import com.intellij.openapi.util.text.StringUtil
|
import com.intellij.util.text.VersionComparatorUtil
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.gradle.MultiplePluginVersionGradleImportingTestCase
|
import org.jetbrains.kotlin.idea.codeInsight.gradle.MultiplePluginVersionGradleImportingTestCase
|
||||||
import org.jetbrains.kotlin.idea.util.sourceRoots
|
import org.jetbrains.kotlin.idea.util.sourceRoots
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
@@ -18,9 +18,9 @@ import java.io.File
|
|||||||
class NewMultiplatformKaptProjectImportingTest : MultiplePluginVersionGradleImportingTestCase() {
|
class NewMultiplatformKaptProjectImportingTest : MultiplePluginVersionGradleImportingTestCase() {
|
||||||
override fun isApplicableTest(): Boolean {
|
override fun isApplicableTest(): Boolean {
|
||||||
val isOldGradlePlugin = gradleKotlinPluginVersion != MINIMAL_SUPPORTED_VERSION
|
val isOldGradlePlugin = gradleKotlinPluginVersion != MINIMAL_SUPPORTED_VERSION
|
||||||
&& StringUtil.compareVersionNumbers(gradleKotlinPluginVersion, "1.3.40") < 0
|
&& VersionComparatorUtil.compare(gradleKotlinPluginVersion, "1.3.40") < 0
|
||||||
|
|
||||||
return !isOldGradlePlugin && !gradleVersion.startsWith("3.")
|
return !isOldGradlePlugin && VersionComparatorUtil.compare(gradleVersion, "4.0") >= 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+1
-1
@@ -228,7 +228,7 @@ abstract class GradleImportingTestCase : ExternalSystemImportingTestCase() {
|
|||||||
|
|
||||||
protected open fun testDataDirName(): String = ""
|
protected open fun testDataDirName(): String = ""
|
||||||
|
|
||||||
protected fun testDataDirectory(): File {
|
protected open fun testDataDirectory(): File {
|
||||||
val baseDir = "${PluginTestCaseBase.getTestDataPathBase()}/gradle/${testDataDirName()}/"
|
val baseDir = "${PluginTestCaseBase.getTestDataPathBase()}/gradle/${testDataDirName()}/"
|
||||||
return File(baseDir, getTestName(true).substringBefore("_"))
|
return File(baseDir, getTestName(true).substringBefore("_"))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user