1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Use direct dependencies to determine the test runner.

This commit is contained in:
Cedric Beust 2016-09-29 10:40:28 -07:00
parent 743ec4e177
commit bc4a28727f

View file

@ -2,7 +2,6 @@ package com.beust.kobalt.internal
import com.beust.kobalt.*
import com.beust.kobalt.api.*
import com.beust.kobalt.maven.DependencyManager2
import com.beust.kobalt.misc.KFiles
import com.google.common.annotations.VisibleForTesting
import java.io.File
@ -24,9 +23,8 @@ abstract class GenericTestRunner: ITestRunnerContributor {
= TaskResult(runTests(project, context, classpath, configName))
override fun affinity(project: Project, context: KobaltContext) : Int {
val td = Kobalt.INJECTOR.getInstance(DependencyManager2::class.java).resolve(project, context, isTest = true)
val result =
if (td.any { it.id.contains(dependencyName) }) IAffinity.DEFAULT_POSITIVE_AFFINITY
if (project.testDependencies.any { it.id.contains(dependencyName) }) IAffinity.DEFAULT_POSITIVE_AFFINITY
else 0
return result
}