From bc4a28727f268d18fb9d9d5dfd45367788832a1b Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 29 Sep 2016 10:40:28 -0700 Subject: [PATCH] Use direct dependencies to determine the test runner. --- .../main/kotlin/com/beust/kobalt/internal/GenericRunner.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt index c0362ea7..bd0f7fc4 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt @@ -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 }