mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27: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
|
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.
|
* @return a list of the transitive dependencies (absolute paths to jar files) for the given dependencies.
|
||||||
* Can be used for example as `collect(compileDependencies)`.
|
* Can be used for example as `collect(compileDependencies)`.
|
||||||
*/
|
*/
|
||||||
@Directive
|
@Directive
|
||||||
fun collect(dependencies: List<IClasspathDependency>) : List<File> {
|
fun collect(dependencies: List<IClasspathDependency>) : List<Dep> {
|
||||||
return Kobalt.context?.dependencyManager?.transitiveClosure(dependencies)?.map { it.jarFile.get() }
|
return (Kobalt.context?.dependencyManager?.transitiveClosure(dependencies) ?: emptyList())
|
||||||
?: emptyList()
|
.map { Dep(it.jarFile.get(), it.id) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString() = "[Project $name]"
|
override fun toString() = "[Project $name]"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue