Generify Gradle importing tests so they can be used in the Ultimate repo

This commit is contained in:
Yan Zhulanow
2019-09-04 16:37:27 +09:00
parent 82c88f9cc4
commit 0a8f15c745
2 changed files with 4 additions and 4 deletions
@@ -9,7 +9,7 @@ import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.roots.*
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.util.sourceRoots
import org.junit.Test
@@ -18,9 +18,9 @@ import java.io.File
class NewMultiplatformKaptProjectImportingTest : MultiplePluginVersionGradleImportingTestCase() {
override fun isApplicableTest(): Boolean {
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
@@ -228,7 +228,7 @@ abstract class GradleImportingTestCase : ExternalSystemImportingTestCase() {
protected open fun testDataDirName(): String = ""
protected fun testDataDirectory(): File {
protected open fun testDataDirectory(): File {
val baseDir = "${PluginTestCaseBase.getTestDataPathBase()}/gradle/${testDataDirName()}/"
return File(baseDir, getTestName(true).substringBefore("_"))
}