1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

--resolve: display the dependencies of the id found.

This commit is contained in:
Cedric Beust 2015-12-13 07:58:04 -08:00
parent f628597dd3
commit 457de8de34

View file

@ -23,13 +23,16 @@ class ResolveDependency @Inject constructor(val repoFinder: RepoFinder) {
class Dep(val dep: IClasspathDependency, val level: Int)
fun run(id: String) {
val indent = -1
val dep = MavenDependency.create(id)
val root = Node(Dep(dep, indent))
val seen = hashSetOf<String>(id)
root.addChildren(findChildren(root, seen))
val repoResult = repoFinder.findCorrectRepo(id)
val indent = -1
val originalDep = MavenDependency.create(id)
// We want to display the dependencies of the id we found, not the one we queries
val dep = MavenDependency.create(originalDep.shortId + repoResult.version)
val root = Node(Dep(dep, indent))
val seen = hashSetOf(id)
root.addChildren(findChildren(root, seen))
val simpleDep = SimpleDep(MavenId.create(id))
val url = repoResult.hostConfig.url + simpleDep.toJarFile(repoResult)
AsciiArt.logBox(listOf(id, url).map { " $it" }, {s -> println(s) })