mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
--projectInfo.
This commit is contained in:
parent
b8cdd96240
commit
c776f214cd
3 changed files with 16 additions and 5 deletions
|
@ -54,8 +54,12 @@ class Args {
|
||||||
@Parameter(names = arrayOf("--profiles"), description = "Comma-separated list of profiles to run")
|
@Parameter(names = arrayOf("--profiles"), description = "Comma-separated list of profiles to run")
|
||||||
var profiles: String? = null
|
var profiles: String? = null
|
||||||
|
|
||||||
@Parameter(names = arrayOf("--resolve"), description = "Resolve the given dependency and display its tree")
|
@Parameter(names = arrayOf("--resolve"),
|
||||||
var dependency: String? = null
|
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")
|
@Parameter(names = arrayOf("--server"), description = "Run in server mode")
|
||||||
var serverMode: Boolean = false
|
var serverMode: Boolean = false
|
||||||
|
|
|
@ -26,7 +26,9 @@ class ResolveDependency @Inject constructor(val repoFinder: RepoFinder,
|
||||||
|
|
||||||
class Dep(val dep: IClasspathDependency, val level: Int)
|
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 repoResult = repoFinder.findCorrectRepo(id)
|
||||||
|
|
||||||
val indent = -1
|
val indent = -1
|
||||||
|
|
|
@ -195,9 +195,14 @@ private class Main @Inject constructor(
|
||||||
|
|
||||||
log(2, "Final list of repos:\n " + Kobalt.repos.joinToString("\n "))
|
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
|
// --resolve
|
||||||
resolveDependency.run(args.dependency as String)
|
resolveDependency.run(args.dependencies!!.split(",").toList())
|
||||||
} else if (args.tasks) {
|
} else if (args.tasks) {
|
||||||
// --tasks
|
// --tasks
|
||||||
displayTasks()
|
displayTasks()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue