mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Implemented --log 0
This commit is contained in:
parent
a6e8dbabb1
commit
014802e272
18 changed files with 76 additions and 103 deletions
|
@ -27,7 +27,7 @@ private fun parseArgs(argv: Array<String>): Main.RunInfo {
|
|||
val args = Args()
|
||||
val result = JCommander(args)
|
||||
result.parse(*argv)
|
||||
KobaltLogger.LOG_LEVEL = if (args.log < 0) {
|
||||
KobaltLogger.LOG_LEVEL = if (args.log < Constants.LOG_QUIET_LEVEL) {
|
||||
Constants.LOG_DEFAULT_LEVEL
|
||||
} else if (args.log > Constants.LOG_MAX_LEVEL) {
|
||||
Constants.LOG_MAX_LEVEL
|
||||
|
@ -110,9 +110,9 @@ private class Main @Inject constructor(
|
|||
private fun runWithArgs(jc: JCommander, args: Args, argv: Array<String>): Int {
|
||||
val p = if (args.buildFile != null) File(args.buildFile) else File(".")
|
||||
args.buildFile = p.absolutePath
|
||||
|
||||
|
||||
if (!args.update) {
|
||||
println(AsciiArt.banner + Kobalt.version + "\n")
|
||||
kobaltLog(1, AsciiArt.banner + Kobalt.version + "\n")
|
||||
}
|
||||
|
||||
return options.run(jc, args, argv)
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
package com.beust.kobalt
|
||||
|
||||
import com.beust.jcommander.JCommander
|
||||
import com.beust.kobalt.api.Kobalt
|
||||
import com.beust.kobalt.api.PluginTask
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.app.ProjectFinder
|
||||
import com.beust.kobalt.app.ProjectGenerator
|
||||
import com.beust.kobalt.app.Templates
|
||||
import com.beust.kobalt.app.UpdateKobalt
|
||||
import com.beust.kobalt.api.*
|
||||
import com.beust.kobalt.app.*
|
||||
import com.beust.kobalt.app.remote.KobaltServer
|
||||
import com.beust.kobalt.internal.PluginInfo
|
||||
import com.beust.kobalt.internal.TaskManager
|
||||
import com.beust.kobalt.internal.build.BuildSources
|
||||
import com.beust.kobalt.misc.CheckVersions
|
||||
import com.beust.kobalt.misc.kobaltLog
|
||||
import com.beust.kobalt.wrapper.Main
|
||||
import com.google.common.collect.HashMultimap
|
||||
import com.google.inject.Inject
|
||||
|
@ -165,6 +161,6 @@ class Options @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
println(sb.toString())
|
||||
kobaltLog(1, sb.toString())
|
||||
}
|
||||
}
|
|
@ -4,16 +4,10 @@ import com.beust.kobalt.Args
|
|||
import com.beust.kobalt.api.IClasspathDependency
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.app.BuildFileCompiler
|
||||
import com.beust.kobalt.internal.DynamicGraph
|
||||
import com.beust.kobalt.internal.GraphUtil
|
||||
import com.beust.kobalt.internal.PluginInfo
|
||||
import com.beust.kobalt.internal.TaskManager
|
||||
import com.beust.kobalt.internal.*
|
||||
import com.beust.kobalt.internal.build.BuildSources
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.KobaltExecutors
|
||||
import com.beust.kobalt.misc.StringVersion
|
||||
import com.beust.kobalt.misc.log
|
||||
import com.beust.kobalt.misc.*
|
||||
import com.google.inject.Inject
|
||||
import java.io.File
|
||||
|
||||
|
@ -170,7 +164,7 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
|
|||
GraphUtil.displayGraph(it.compileDependencies,
|
||||
{dd: DependencyData -> dd.children },
|
||||
{dd: DependencyData, indent: String ->
|
||||
println(" " + indent + dd.id + " " + (if (! dd.isLatest) "(old)" else ""))
|
||||
log(1, " " + indent + dd.id + " " + (if (! dd.isLatest) "(old)" else ""))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,7 @@ import com.beust.kobalt.archive.Archives
|
|||
import com.beust.kobalt.internal.ActorUtils
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.beust.kobalt.maven.aether.Scope
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.KobaltExecutors
|
||||
import com.beust.kobalt.misc.RunCommand
|
||||
import com.beust.kobalt.misc.*
|
||||
import com.beust.kobalt.plugin.packaging.PackageConfig
|
||||
import com.beust.kobalt.plugin.packaging.PackagingPlugin
|
||||
import com.google.inject.Inject
|
||||
|
@ -128,11 +126,11 @@ class ApplicationPlugin @Inject constructor(val configActor: ConfigActor<Applica
|
|||
val args = contributorFlags + initialArgs + config.args
|
||||
val exitCode = RunCommand(java.absolutePath).run(args,
|
||||
successCallback = { output: List<String> ->
|
||||
println(output.joinToString("\n"))
|
||||
kobaltLog(1, output.joinToString("\n"))
|
||||
},
|
||||
errorCallback = { output: List<String> ->
|
||||
println("ERROR")
|
||||
println(output.joinToString("\n"))
|
||||
kobaltLog(1, "ERROR")
|
||||
kobaltLog(1, output.joinToString("\n"))
|
||||
}
|
||||
)
|
||||
return TaskResult(exitCode == 0)
|
||||
|
|
|
@ -2,11 +2,10 @@ package com.beust.kobalt
|
|||
|
||||
import com.beust.kobalt.api.KobaltContext
|
||||
import com.beust.kobalt.app.MainModule
|
||||
import com.beust.kobalt.internal.ILogger
|
||||
import com.beust.kobalt.internal.KobaltSettings
|
||||
import com.beust.kobalt.internal.KobaltSettingsXml
|
||||
import com.beust.kobalt.internal.*
|
||||
import com.beust.kobalt.maven.LocalRepo
|
||||
import com.beust.kobalt.maven.aether.KobaltMavenResolver
|
||||
import com.beust.kobalt.misc.kobaltLog
|
||||
import com.google.common.eventbus.EventBus
|
||||
import com.google.inject.Provider
|
||||
import com.google.inject.Scopes
|
||||
|
@ -32,7 +31,7 @@ class TestModule : MainModule(Args(), TEST_KOBALT_SETTINGS) {
|
|||
resolver = testResolver
|
||||
logger = object: ILogger {
|
||||
override fun log(tag: CharSequence, level: Int, message: CharSequence, newLine: Boolean) {
|
||||
println("TestLog: [$tag $level] " + message)
|
||||
kobaltLog(1, "TestLog: [$tag $level] " + message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class DynamicGraphTest {
|
|||
assertThat(transitiveClosure(3)).isEqualTo(listOf(3))
|
||||
assertThat(transitiveClosure(6)).isEqualTo(listOf(6, 7))
|
||||
assertThat(transitiveClosure(7)).isEqualTo(listOf(7))
|
||||
println("done")
|
||||
kobaltLog(1, "done")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue