mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
GITHUB-382: Expose Project.collect() to gather dependencies in the build file.
Fixes https://github.com/cbeust/kobalt/issues/382
This commit is contained in:
parent
570f9a0bb7
commit
789c969a9b
1 changed files with 12 additions and 0 deletions
|
@ -128,6 +128,18 @@ open class Project(
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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<String> {
|
||||||
|
return Kobalt.context?.dependencyManager?.transitiveClosure(dependencies)?.map { it.jarFile.get() }
|
||||||
|
?.map { it.absolutePath}
|
||||||
|
?: emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun toString() = "[Project $name]"
|
override fun toString() = "[Project $name]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue