mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Fix excluded dependencies.
This commit is contained in:
parent
58d5101e11
commit
10967067f7
1 changed files with 13 additions and 6 deletions
|
@ -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<IClasspathDependency>) = { dep: IClasspathDependency ->
|
||||
if (excluded.contains(dep)) {
|
||||
log(2, " Excluding $dep")
|
||||
}
|
||||
! excluded.contains(dep) && ! dep.optional
|
||||
}
|
||||
|
||||
fun compileDependenciesGraph(project: Project, name: String): List<DependencyData> {
|
||||
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<DependencyData>) : Map<String, String> {
|
||||
|
@ -116,7 +122,8 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
|
|||
|
||||
fun testDependenciesGraph(project: Project, name: String): List<DependencyData> {
|
||||
val depLambda = IClasspathDependency::directDependencies
|
||||
return DynamicGraph.Companion.transitiveClosureGraph(project.testDependencies, depLambda, OPTIONAL_FILTER)
|
||||
return DynamicGraph.Companion.transitiveClosureGraph(project.testDependencies, depLambda,
|
||||
dependencyFilter(project.excludedDependencies))
|
||||
.map { toDependencyData2("testCompile", it)}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue