mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Make --resolve accept only one id.
Necessary for version ranges, which are defined with a comma.
This commit is contained in:
parent
6121ec0ac3
commit
efca7320bb
3 changed files with 12 additions and 7 deletions
|
@ -72,8 +72,8 @@ class Args {
|
||||||
var profiling: Boolean = false
|
var profiling: Boolean = false
|
||||||
|
|
||||||
@Parameter(names = arrayOf("--resolve"),
|
@Parameter(names = arrayOf("--resolve"),
|
||||||
description = "Resolve the given comma-separated dependencies and display their dependency tree")
|
description = "Resolve the given dependency and display its tree")
|
||||||
var dependencies: String? = null
|
var dependency: String? = null
|
||||||
|
|
||||||
@Parameter(names = arrayOf("--projectInfo"), description = "Display information about the current projects")
|
@Parameter(names = arrayOf("--projectInfo"), description = "Display information about the current projects")
|
||||||
var projectInfo: Boolean = false
|
var projectInfo: Boolean = false
|
||||||
|
|
|
@ -25,7 +25,7 @@ class ResolveDependency @Inject constructor(
|
||||||
|
|
||||||
class Dep(val dep: IClasspathDependency, val level: Int)
|
class Dep(val dep: IClasspathDependency, val level: Int)
|
||||||
|
|
||||||
fun run(ids: List<String>) = ids.forEach { displayDependenciesFor(it) }
|
fun run(id: String) = displayDependenciesFor(id)
|
||||||
|
|
||||||
private fun displayDependenciesFor(id: String) {
|
private fun displayDependenciesFor(id: String) {
|
||||||
val mavenId = MavenId.create(id)
|
val mavenId = MavenId.create(id)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.beust.kobalt.api.IClasspathDependency
|
||||||
import com.beust.kobalt.api.Kobalt
|
import com.beust.kobalt.api.Kobalt
|
||||||
import com.beust.kobalt.api.PluginTask
|
import com.beust.kobalt.api.PluginTask
|
||||||
import com.beust.kobalt.app.*
|
import com.beust.kobalt.app.*
|
||||||
|
import com.beust.kobalt.app.remote.DependencyData
|
||||||
import com.beust.kobalt.app.remote.KobaltClient
|
import com.beust.kobalt.app.remote.KobaltClient
|
||||||
import com.beust.kobalt.app.remote.KobaltServer
|
import com.beust.kobalt.app.remote.KobaltServer
|
||||||
import com.beust.kobalt.internal.Gc
|
import com.beust.kobalt.internal.Gc
|
||||||
|
@ -68,6 +69,7 @@ private class Main @Inject constructor(
|
||||||
val projectGenerator: ProjectGenerator,
|
val projectGenerator: ProjectGenerator,
|
||||||
val serverFactory: KobaltServer.IFactory,
|
val serverFactory: KobaltServer.IFactory,
|
||||||
val projectFinder: ProjectFinder,
|
val projectFinder: ProjectFinder,
|
||||||
|
val dependencyData: DependencyData,
|
||||||
val resolveDependency: ResolveDependency) {
|
val resolveDependency: ResolveDependency) {
|
||||||
|
|
||||||
data class RunInfo(val jc: JCommander, val args: Args)
|
data class RunInfo(val jc: JCommander, val args: Args)
|
||||||
|
@ -181,17 +183,20 @@ private class Main @Inject constructor(
|
||||||
val allProjects = projectFinder.initForBuildFile(buildFile, args)
|
val allProjects = projectFinder.initForBuildFile(buildFile, args)
|
||||||
|
|
||||||
// DONOTCOMMIT
|
// DONOTCOMMIT
|
||||||
// val data = dependencyData.dependenciesDataFor(homeDir("kotlin/klaxon/kobalt/src/Build.kt"), Args())
|
// val data = dependencyData.dependenciesDataFor(homeDir("kotlin/klaxon/kobalt/src/Build.kt"), Args(),
|
||||||
|
// useGraph = true)
|
||||||
// println("Data: $data")
|
// println("Data: $data")
|
||||||
|
|
||||||
if (args.projectInfo) {
|
if (args.projectInfo) {
|
||||||
// --projectInfo
|
// --projectInfo
|
||||||
allProjects.forEach {
|
allProjects.forEach {
|
||||||
resolveDependency.run(it.compileDependencies.map { it.id })
|
it.compileDependencies.forEach {
|
||||||
|
resolveDependency.run(it.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (args.dependencies != null) {
|
} else if (args.dependency != null) {
|
||||||
// --resolve
|
// --resolve
|
||||||
resolveDependency.run(args.dependencies!!.split(',').toList())
|
args.dependency?.let { resolveDependency.run(it) }
|
||||||
} else if (args.tasks) {
|
} else if (args.tasks) {
|
||||||
// --tasks
|
// --tasks
|
||||||
displayTasks()
|
displayTasks()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue