mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Higher logging for Aether stuff.
This commit is contained in:
parent
299f556fe7
commit
29d31139eb
3 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.beust.kobalt.maven
|
package com.beust.kobalt.maven
|
||||||
|
|
||||||
import com.beust.kobalt.api.*
|
import com.beust.kobalt.api.*
|
||||||
|
import com.beust.kobalt.maven.aether.ConsoleRepositoryListener
|
||||||
import com.beust.kobalt.maven.aether.KobaltAether
|
import com.beust.kobalt.maven.aether.KobaltAether
|
||||||
import com.beust.kobalt.maven.dependency.FileDependency
|
import com.beust.kobalt.maven.dependency.FileDependency
|
||||||
import com.beust.kobalt.misc.KFiles
|
import com.beust.kobalt.misc.KFiles
|
||||||
|
@ -108,7 +109,7 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val
|
||||||
var result = hashSetOf<IClasspathDependency>()
|
var result = hashSetOf<IClasspathDependency>()
|
||||||
|
|
||||||
dependencies.forEach { projectDependency ->
|
dependencies.forEach { projectDependency ->
|
||||||
log(3, "$indent Resolving $projectDependency")
|
log(ConsoleRepositoryListener.LOG_LEVEL, "$indent Resolving $projectDependency")
|
||||||
result.add(projectDependency)
|
result.add(projectDependency)
|
||||||
projectDependency.id.let {
|
projectDependency.id.let {
|
||||||
result.add(create(it))
|
result.add(create(it))
|
||||||
|
|
|
@ -49,7 +49,7 @@ class KobaltAether @Inject constructor (val settings: KobaltSettings, val aether
|
||||||
}
|
}
|
||||||
|
|
||||||
fun resolve(id: String): DependencyResult {
|
fun resolve(id: String): DependencyResult {
|
||||||
log(3, "Resolving $id")
|
log(ConsoleRepositoryListener.LOG_LEVEL, "Resolving $id")
|
||||||
val results = aether.resolve(DefaultArtifact(MavenId.toKobaltId(id)))
|
val results = aether.resolve(DefaultArtifact(MavenId.toKobaltId(id)))
|
||||||
if (results != null && results.size > 0) {
|
if (results != null && results.size > 0) {
|
||||||
return DependencyResult(AetherDependency(results[0].artifact), results[0].repository.toString())
|
return DependencyResult(AetherDependency(results[0].artifact), results[0].repository.toString())
|
||||||
|
@ -201,11 +201,11 @@ class AetherDependency(val artifact: Artifact): IClasspathDependency, Comparable
|
||||||
if (! it.dependency.isOptional) {
|
if (! it.dependency.isOptional) {
|
||||||
result.add(AetherDependency(it.artifact))
|
result.add(AetherDependency(it.artifact))
|
||||||
} else {
|
} else {
|
||||||
log(3, "Skipping optional dependency " + deps.root.artifact)
|
log(ConsoleRepositoryListener.LOG_LEVEL, "Skipping optional dependency " + deps.root.artifact)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log(3, "Skipping optional dependency " + deps.root.artifact)
|
log(ConsoleRepositoryListener.LOG_LEVEL, "Skipping optional dependency " + deps.root.artifact)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
warn("Couldn't resolve $artifact")
|
warn("Couldn't resolve $artifact")
|
||||||
|
|
|
@ -9,7 +9,9 @@ import java.io.PrintStream
|
||||||
* A simplistic repository listener that logs events to the console.
|
* A simplistic repository listener that logs events to the console.
|
||||||
*/
|
*/
|
||||||
class ConsoleRepositoryListener @JvmOverloads constructor(out: PrintStream? = null) : AbstractRepositoryListener() {
|
class ConsoleRepositoryListener @JvmOverloads constructor(out: PrintStream? = null) : AbstractRepositoryListener() {
|
||||||
val LOG_LEVEL = 3
|
companion object {
|
||||||
|
val LOG_LEVEL = 4
|
||||||
|
}
|
||||||
|
|
||||||
private val out: PrintStream
|
private val out: PrintStream
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue