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
|
||||
|
||||
@Parameter(names = arrayOf("--resolve"),
|
||||
description = "Resolve the given comma-separated dependencies and display their dependency tree")
|
||||
var dependencies: String? = null
|
||||
description = "Resolve the given dependency and display its tree")
|
||||
var dependency: String? = null
|
||||
|
||||
@Parameter(names = arrayOf("--projectInfo"), description = "Display information about the current projects")
|
||||
var projectInfo: Boolean = false
|
||||
|
|
|
@ -25,7 +25,7 @@ class ResolveDependency @Inject constructor(
|
|||
|
||||
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) {
|
||||
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.PluginTask
|
||||
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.KobaltServer
|
||||
import com.beust.kobalt.internal.Gc
|
||||
|
@ -68,6 +69,7 @@ private class Main @Inject constructor(
|
|||
val projectGenerator: ProjectGenerator,
|
||||
val serverFactory: KobaltServer.IFactory,
|
||||
val projectFinder: ProjectFinder,
|
||||
val dependencyData: DependencyData,
|
||||
val resolveDependency: ResolveDependency) {
|
||||
|
||||
data class RunInfo(val jc: JCommander, val args: Args)
|
||||
|
@ -181,17 +183,20 @@ private class Main @Inject constructor(
|
|||
val allProjects = projectFinder.initForBuildFile(buildFile, args)
|
||||
|
||||
// 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")
|
||||
|
||||
if (args.projectInfo) {
|
||||
// --projectInfo
|
||||
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
|
||||
resolveDependency.run(args.dependencies!!.split(',').toList())
|
||||
args.dependency?.let { resolveDependency.run(it) }
|
||||
} else if (args.tasks) {
|
||||
// --tasks
|
||||
displayTasks()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue