Launch common tests on local JVM via run gutter

For projects with android target and without jvm one. #KT-42463
This commit is contained in:
Kirill Shmakov
2020-10-20 18:02:28 +03:00
parent 1c1e8f7beb
commit 29aaf70d21
2 changed files with 29 additions and 16 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 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.
*/
@@ -473,8 +473,7 @@ open class KotlinMPPGradleProjectResolver : AbstractProjectResolverExtensionComp
val dependsOnReverseGraph: MutableMap<String, MutableSet<KotlinSourceSet>> = HashMap()
mppModel.targets.forEach { target ->
target.compilations.forEach { compilation ->
val testRunTasks = target.testRunTasks
.filter { task -> task.compilationName == compilation.name }
val testRunTasks = target.testTasksFor(compilation)
.map {
ExternalSystemTestRunTask(
it.taskName,
@@ -1102,6 +1101,13 @@ open class KotlinMPPGradleProjectResolver : AbstractProjectResolverExtensionComp
}
}
private fun KotlinTarget.testTasksFor(compilation: KotlinCompilation) = testRunTasks.filter { task ->
when (name) {
"android" -> task.taskName.endsWith(compilation.name, true)
else -> task.compilationName == compilation.name
}
}
fun ProjectResolverContext.getMppModel(gradleModule: IdeaModule): KotlinMPPGradleModel? {
val mppModel = this.getExtraProject(gradleModule, KotlinMPPGradleModel::class.java)
return if (mppModel is Proxy) {