mirror of https://github.com/sbt/sbt.git
Fix output silencing
Plugin should now really not print anything if nothing is downloaded
This commit is contained in:
parent
c35e0f851b
commit
30a8f119bd
|
|
@ -579,6 +579,8 @@ object Tasks {
|
||||||
var pool: ExecutorService = null
|
var pool: ExecutorService = null
|
||||||
var resLogger: TermDisplay = null
|
var resLogger: TermDisplay = null
|
||||||
|
|
||||||
|
val printOptionalMessage = verbosityLevel >= 0 && verbosityLevel <= 1
|
||||||
|
|
||||||
val res = try {
|
val res = try {
|
||||||
pool = Executors.newFixedThreadPool(parallelDownloads, Strategy.DefaultDaemonThreadFactory)
|
pool = Executors.newFixedThreadPool(parallelDownloads, Strategy.DefaultDaemonThreadFactory)
|
||||||
resLogger = createLogger()
|
resLogger = createLogger()
|
||||||
|
|
@ -629,10 +631,10 @@ object Tasks {
|
||||||
Nil
|
Nil
|
||||||
).flatten.mkString("\n")
|
).flatten.mkString("\n")
|
||||||
|
|
||||||
if (verbosityLevel >= 1)
|
if (verbosityLevel >= 2)
|
||||||
log.info(initialMessage)
|
log.info(initialMessage)
|
||||||
|
|
||||||
resLogger.init(if (verbosityLevel < 1) log.info(initialMessage))
|
resLogger.init(if (printOptionalMessage) log.info(initialMessage))
|
||||||
|
|
||||||
startRes
|
startRes
|
||||||
.process
|
.process
|
||||||
|
|
@ -647,7 +649,7 @@ object Tasks {
|
||||||
if (pool != null)
|
if (pool != null)
|
||||||
pool.shutdown()
|
pool.shutdown()
|
||||||
if (resLogger != null)
|
if (resLogger != null)
|
||||||
if ((resLogger.stopDidPrintSomething() && verbosityLevel >= 0) || verbosityLevel >= 1)
|
if ((resLogger.stopDidPrintSomething() && printOptionalMessage) || verbosityLevel >= 2)
|
||||||
log.info(s"Resolved $projectName dependencies")
|
log.info(s"Resolved $projectName dependencies")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -821,6 +823,8 @@ object Tasks {
|
||||||
var pool: ExecutorService = null
|
var pool: ExecutorService = null
|
||||||
var artifactsLogger: TermDisplay = null
|
var artifactsLogger: TermDisplay = null
|
||||||
|
|
||||||
|
val printOptionalMessage = verbosityLevel >= 0 && verbosityLevel <= 1
|
||||||
|
|
||||||
val artifactFilesOrErrors = try {
|
val artifactFilesOrErrors = try {
|
||||||
pool = Executors.newFixedThreadPool(parallelDownloads, Strategy.DefaultDaemonThreadFactory)
|
pool = Executors.newFixedThreadPool(parallelDownloads, Strategy.DefaultDaemonThreadFactory)
|
||||||
artifactsLogger = createLogger()
|
artifactsLogger = createLogger()
|
||||||
|
|
@ -850,10 +854,10 @@ object Tasks {
|
||||||
else
|
else
|
||||||
""
|
""
|
||||||
|
|
||||||
if (verbosityLevel >= 1)
|
if (verbosityLevel >= 2)
|
||||||
log.info(artifactInitialMessage)
|
log.info(artifactInitialMessage)
|
||||||
|
|
||||||
artifactsLogger.init(if (verbosityLevel < 1) log.info(artifactInitialMessage))
|
artifactsLogger.init(if (printOptionalMessage) log.info(artifactInitialMessage))
|
||||||
|
|
||||||
Task.gatherUnordered(artifactFileOrErrorTasks).attemptRun match {
|
Task.gatherUnordered(artifactFileOrErrorTasks).attemptRun match {
|
||||||
case -\/(ex) =>
|
case -\/(ex) =>
|
||||||
|
|
@ -866,7 +870,7 @@ object Tasks {
|
||||||
if (pool != null)
|
if (pool != null)
|
||||||
pool.shutdown()
|
pool.shutdown()
|
||||||
if (artifactsLogger != null)
|
if (artifactsLogger != null)
|
||||||
if ((artifactsLogger.stopDidPrintSomething() && verbosityLevel >= 0) || verbosityLevel >= 1)
|
if ((artifactsLogger.stopDidPrintSomething() && printOptionalMessage) || verbosityLevel >= 2)
|
||||||
log.info(
|
log.info(
|
||||||
s"Fetched artifacts of $projectName" +
|
s"Fetched artifacts of $projectName" +
|
||||||
(if (sbtClassifiers) " (sbt classifiers)" else "")
|
(if (sbtClassifiers) " (sbt classifiers)" else "")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue