Partially revert "Prefer Kotlin Gradle test run configurations when possible (KT-33787)"
This commit reverts 987307cf92.
Tests are left behind as the different fix will be provided for KT-33787.
This commit is contained in:
+2
-7
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.idea.run
|
||||
import com.intellij.execution.Location
|
||||
import com.intellij.execution.actions.ConfigurationContext
|
||||
import com.intellij.execution.actions.ConfigurationFromContext
|
||||
import com.intellij.execution.configurations.ConfigurationFactory
|
||||
import com.intellij.execution.junit.InheritorChooser
|
||||
import com.intellij.openapi.externalSystem.service.execution.ExternalSystemRunConfiguration
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
|
||||
@@ -44,11 +43,11 @@ abstract class AbstractKotlinMultiplatformTestClassGradleConfigurationProducer :
|
||||
}
|
||||
|
||||
override fun isPreferredConfiguration(self: ConfigurationFromContext, other: ConfigurationFromContext): Boolean {
|
||||
return other.isJpsJunitConfiguration() || super.isPreferredConfiguration(self, other)
|
||||
return other.isJpsJunitConfiguration()
|
||||
}
|
||||
|
||||
override fun shouldReplace(self: ConfigurationFromContext, other: ConfigurationFromContext): Boolean {
|
||||
return other.isJpsJunitConfiguration() || super.shouldReplace(self, other)
|
||||
return other.isJpsJunitConfiguration()
|
||||
}
|
||||
|
||||
override fun onFirstRun(fromContext: ConfigurationFromContext, context: ConfigurationContext, performRunnable: Runnable) {
|
||||
@@ -97,10 +96,6 @@ abstract class AbstractKotlinMultiplatformTestClassGradleConfigurationProducer :
|
||||
|
||||
abstract class AbstractKotlinTestClassGradleConfigurationProducer
|
||||
: TestClassGradleConfigurationProducer(), KotlinGradleConfigurationProducer {
|
||||
override fun getConfigurationFactory(): ConfigurationFactory {
|
||||
return KotlinGradleExternalTaskConfigurationType.instance.factory
|
||||
}
|
||||
|
||||
override fun isConfigurationFromContext(configuration: ExternalSystemRunConfiguration, context: ConfigurationContext): Boolean {
|
||||
if (!context.check()) {
|
||||
return false
|
||||
|
||||
+2
-7
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.idea.run
|
||||
import com.intellij.execution.Location
|
||||
import com.intellij.execution.actions.ConfigurationContext
|
||||
import com.intellij.execution.actions.ConfigurationFromContext
|
||||
import com.intellij.execution.configurations.ConfigurationFactory
|
||||
import com.intellij.execution.junit.InheritorChooser
|
||||
import com.intellij.openapi.externalSystem.service.execution.ExternalSystemRunConfiguration
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
|
||||
@@ -44,11 +43,11 @@ abstract class AbstractKotlinMultiplatformTestMethodGradleConfigurationProducer
|
||||
}
|
||||
|
||||
override fun isPreferredConfiguration(self: ConfigurationFromContext, other: ConfigurationFromContext): Boolean {
|
||||
return other.isJpsJunitConfiguration() || super.isPreferredConfiguration(self, other)
|
||||
return other.isJpsJunitConfiguration()
|
||||
}
|
||||
|
||||
override fun shouldReplace(self: ConfigurationFromContext, other: ConfigurationFromContext): Boolean {
|
||||
return other.isJpsJunitConfiguration() || super.shouldReplace(self, other)
|
||||
return other.isJpsJunitConfiguration()
|
||||
}
|
||||
|
||||
override fun onFirstRun(fromContext: ConfigurationFromContext, context: ConfigurationContext, performRunnable: Runnable) {
|
||||
@@ -100,10 +99,6 @@ abstract class AbstractKotlinMultiplatformTestMethodGradleConfigurationProducer
|
||||
|
||||
abstract class AbstractKotlinTestMethodGradleConfigurationProducer
|
||||
: TestMethodGradleConfigurationProducer(), KotlinGradleConfigurationProducer {
|
||||
override fun getConfigurationFactory(): ConfigurationFactory {
|
||||
return KotlinGradleExternalTaskConfigurationType.instance.factory
|
||||
}
|
||||
|
||||
override fun isConfigurationFromContext(configuration: ExternalSystemRunConfiguration, context: ConfigurationContext): Boolean {
|
||||
if (!context.check()) {
|
||||
return false
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* 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.run
|
||||
|
||||
import com.intellij.execution.configurations.ConfigurationFactory
|
||||
import com.intellij.execution.configurations.ConfigurationTypeUtil
|
||||
import com.intellij.openapi.externalSystem.model.ProjectSystemId
|
||||
import com.intellij.openapi.externalSystem.service.execution.AbstractExternalSystemTaskConfigurationType
|
||||
import com.intellij.openapi.externalSystem.service.execution.ExternalSystemRunConfiguration
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.plugins.gradle.service.execution.GradleRunConfiguration
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants
|
||||
|
||||
class KotlinGradleExternalTaskConfigurationType : AbstractExternalSystemTaskConfigurationType(GradleConstants.SYSTEM_ID) {
|
||||
companion object {
|
||||
val instance: KotlinGradleExternalTaskConfigurationType
|
||||
get() = ConfigurationTypeUtil.findConfigurationType(KotlinGradleExternalTaskConfigurationType::class.java)
|
||||
}
|
||||
|
||||
override fun getId() = "Kotlin" + externalSystemId.readableName + "RunConfiguration"
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
override fun getHelpTopic() = "reference.dialogs.rundebug.GradleRunConfiguration"
|
||||
|
||||
override fun getDisplayName() = "Kotlin Gradle"
|
||||
override fun getConfigurationTypeDescription() = "Kotlin Gradle build"
|
||||
|
||||
override fun doCreateConfiguration(
|
||||
externalSystemId: ProjectSystemId,
|
||||
project: Project,
|
||||
factory: ConfigurationFactory,
|
||||
name: String
|
||||
): ExternalSystemRunConfiguration {
|
||||
return KotlinGradleRunConfiguration(project, factory, name)
|
||||
}
|
||||
}
|
||||
|
||||
class KotlinGradleRunConfiguration(project: Project?, factory: ConfigurationFactory?, name: String?) :
|
||||
GradleRunConfiguration(project, factory, name)
|
||||
+3
-3
@@ -16,8 +16,8 @@ import com.intellij.openapi.vfs.VfsUtil
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.gradle.GradleDaemonAnalyzerTestCase
|
||||
import org.jetbrains.kotlin.gradle.checkFiles
|
||||
import org.jetbrains.kotlin.idea.run.KotlinGradleRunConfiguration
|
||||
import org.jetbrains.kotlin.test.TagsTestDataUtil
|
||||
import org.jetbrains.plugins.gradle.service.execution.GradleRunConfiguration
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
|
||||
@@ -64,7 +64,7 @@ class GradleTestRunConfigurationAndHighlightingTest : GradleImportingTestCase()
|
||||
if ("Run Test" !in lineMarkerInfo.lineMarkerTooltip.orEmpty()) return null
|
||||
|
||||
val kotlinConfigsFromContext = lineMarkerInfo.extractConfigurationsFromContext()
|
||||
.filter { it.configuration is KotlinGradleRunConfiguration }
|
||||
.filter { it.configuration is GradleRunConfiguration }
|
||||
|
||||
if (kotlinConfigsFromContext.isEmpty()) return "settings=\"Nothing here\""
|
||||
|
||||
@@ -100,7 +100,7 @@ class GradleTestRunConfigurationAndHighlightingTest : GradleImportingTestCase()
|
||||
}
|
||||
|
||||
private fun ConfigurationFromContext.renderDescription(tagsToRender: List<RunConfigurationsTags>): String {
|
||||
val configuration = configuration as KotlinGradleRunConfiguration
|
||||
val configuration = configuration as GradleRunConfiguration
|
||||
|
||||
val location = PsiLocation(sourceElement)
|
||||
val context = ConfigurationContext.createEmptyContextForLocation(location)
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<configurationType implementation="org.jetbrains.kotlin.idea.run.KotlinGradleExternalTaskConfigurationType"/>
|
||||
<projectTaskRunner implementation="org.jetbrains.kotlin.idea.gradle.execution.KotlinMPPGradleProjectTaskRunner" order="first, before gradle"/>
|
||||
<externalProjectDataService implementation="org.jetbrains.kotlin.idea.configuration.KotlinSourceSetDataService"/>
|
||||
<externalProjectDataService implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleProjectSettingsDataService"/>
|
||||
|
||||
Reference in New Issue
Block a user