1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-24 15:37:12 -07:00

Name for the filter.

This commit is contained in:
Cedric Beust 2017-04-07 15:16:53 -07:00
parent 9c73bc717a
commit 40ab79456b

View file

@ -1,6 +1,8 @@
package com.beust.kobalt.maven.aether
import com.beust.kobalt.misc.kobaltLog
import org.eclipse.aether.graph.DependencyFilter
import org.eclipse.aether.graph.DependencyNode
import org.eclipse.aether.util.artifact.JavaScopes
object Filters {
@ -9,7 +11,15 @@ object Filters {
}
val TEST_FILTER = DependencyFilter { p0, p1 -> p0.dependency.scope == JavaScopes.TEST }
val EXCLUDE_OPTIONAL_FILTER = DependencyFilter { p0, p1 ->
p0.dependency != null && ! p0.dependency.optional
val EXCLUDE_OPTIONAL_FILTER = object: DependencyFilter {
override fun accept(p0: DependencyNode, p1: MutableList<DependencyNode>): Boolean {
val result = p0.dependency != null && ! p0.dependency.optional
if (! result) {
kobaltLog(2, "Excluding from optional filter: $p0")
}
return result
}
override fun toString() = "EXCLUDE_OPTIONAL_FILTER"
}
}