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

--projectInfo.

This commit is contained in:
Cedric Beust 2016-03-09 02:25:12 +04:00
parent b8cdd96240
commit c776f214cd
3 changed files with 16 additions and 5 deletions

View file

@ -54,8 +54,12 @@ class Args {
@Parameter(names = arrayOf("--profiles"), description = "Comma-separated list of profiles to run")
var profiles: String? = null
@Parameter(names = arrayOf("--resolve"), description = "Resolve the given dependency and display its tree")
var dependency: String? = null
@Parameter(names = arrayOf("--resolve"),
description = "Resolve the given comma-separated dependencies and display their dependency tree")
var dependencies: String? = null
@Parameter(names = arrayOf("--projectInfo"), description = "Display information about the current projects")
var projectInfo: Boolean = false
@Parameter(names = arrayOf("--server"), description = "Run in server mode")
var serverMode: Boolean = false

View file

@ -26,7 +26,9 @@ class ResolveDependency @Inject constructor(val repoFinder: RepoFinder,
class Dep(val dep: IClasspathDependency, val level: Int)
fun run(id: String) {
fun run(ids: List<String>) = ids.forEach { displayDependenciesFor(it) }
private fun displayDependenciesFor(id: String) {
val repoResult = repoFinder.findCorrectRepo(id)
val indent = -1

View file

@ -195,9 +195,14 @@ private class Main @Inject constructor(
log(2, "Final list of repos:\n " + Kobalt.repos.joinToString("\n "))
if (args.dependency != null) {
if (args.projectInfo) {
// --projectInfo
allProjects.forEach {
resolveDependency.run(it.compileDependencies.map {it.id})
}
} else if (args.dependencies != null) {
// --resolve
resolveDependency.run(args.dependency as String)
resolveDependency.run(args.dependencies!!.split(",").toList())
} else if (args.tasks) {
// --tasks
displayTasks()