diff --git a/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt b/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt index fb7bc8b1..c8d4925b 100644 --- a/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt +++ b/src/main/kotlin/com/beust/kobalt/app/remote/RemoteDependencyData.kt @@ -66,15 +66,21 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v children = node.children.map { toDependencyData2(scope, it) }) } - val OPTIONAL_FILTER = { dep: IClasspathDependency -> ! dep.optional } + fun dependencyFilter(excluded: List) = { dep: IClasspathDependency -> + if (excluded.contains(dep)) { + log(2, " Excluding $dep") + } + ! excluded.contains(dep) && ! dep.optional + } fun compileDependenciesGraph(project: Project, name: String): List { val depLambda = IClasspathDependency::directDependencies - val result = + val resultDep = (DynamicGraph.Companion.transitiveClosureGraph(project.compileDependencies, depLambda, - OPTIONAL_FILTER) + + dependencyFilter(project.excludedDependencies)) + DynamicGraph.Companion.transitiveClosureGraph(project.compileProvidedDependencies, depLambda, - OPTIONAL_FILTER)) + dependencyFilter(project.excludedDependencies))) + val result = resultDep .map { toDependencyData2("compile", it)} fun mapOfLatestVersions(l: List) : Map { @@ -116,8 +122,9 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v fun testDependenciesGraph(project: Project, name: String): List { val depLambda = IClasspathDependency::directDependencies - return DynamicGraph.Companion.transitiveClosureGraph(project.testDependencies, depLambda, OPTIONAL_FILTER) - .map { toDependencyData2("testCompile", it)} + return DynamicGraph.Companion.transitiveClosureGraph(project.testDependencies, depLambda, + dependencyFilter(project.excludedDependencies)) + .map { toDependencyData2("testCompile", it)} } val allTasks = hashSetOf()