mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-25 07:57:12 -07:00
GH-392: Make collect() return both File and id.
Fixes https://github.com/cbeust/kobalt/issues/392
This commit is contained in:
parent
5ae20fb253
commit
e19b3472a7
1 changed files with 5 additions and 3 deletions
|
@ -128,14 +128,16 @@ open class Project(
|
|||
return result
|
||||
}
|
||||
|
||||
class Dep(val File: File, val id: String)
|
||||
|
||||
/**
|
||||
* @return a list of the transitive dependencies (absolute paths to jar files) for the given dependencies.
|
||||
* Can be used for example as `collect(compileDependencies)`.
|
||||
*/
|
||||
@Directive
|
||||
fun collect(dependencies: List<IClasspathDependency>) : List<File> {
|
||||
return Kobalt.context?.dependencyManager?.transitiveClosure(dependencies)?.map { it.jarFile.get() }
|
||||
?: emptyList()
|
||||
fun collect(dependencies: List<IClasspathDependency>) : List<Dep> {
|
||||
return (Kobalt.context?.dependencyManager?.transitiveClosure(dependencies) ?: emptyList())
|
||||
.map { Dep(it.jarFile.get(), it.id) }
|
||||
}
|
||||
|
||||
override fun toString() = "[Project $name]"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue