mirror of https://github.com/sbt/sbt.git
silence coursier log when supershell is off
This commit is contained in:
parent
1ba195a4f5
commit
9137e21028
|
|
@ -242,7 +242,7 @@ object Defaults extends BuildCommon {
|
|||
forceUpdatePeriod :== None,
|
||||
// coursier settings
|
||||
csrExtraCredentials :== Nil,
|
||||
csrLogger :== None,
|
||||
csrLogger := LMCoursier.coursierLoggerTask.value,
|
||||
csrCachePath :== LMCoursier.defaultCacheLocation,
|
||||
csrMavenProfiles :== Set.empty,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,11 +9,12 @@ package sbt
|
|||
package internal
|
||||
|
||||
import java.io.File
|
||||
import lmcoursier.definitions.{ Classifier, Configuration => CConfiguration }
|
||||
import lmcoursier.definitions.{ Classifier, Configuration => CConfiguration, CacheLogger }
|
||||
import lmcoursier._
|
||||
import sbt.librarymanagement._
|
||||
import Keys._
|
||||
import sbt.internal.librarymanagement.{ CoursierArtifactsTasks, CoursierInputsTasks }
|
||||
import sbt.util.Logger
|
||||
|
||||
private[sbt] object LMCoursier {
|
||||
def defaultCacheLocation: File = CoursierDependencyResolution.defaultCacheLocation
|
||||
|
|
@ -89,6 +90,18 @@ private[sbt] object LMCoursier {
|
|||
}
|
||||
}
|
||||
|
||||
def coursierLoggerTask: Def.Initialize[Task[Option[CacheLogger]]] = Def.task {
|
||||
val st = Keys.streams.value
|
||||
val progress = useSuperShell.value
|
||||
if (progress) None
|
||||
else Some(new CoursierLogger(st.log))
|
||||
}
|
||||
|
||||
private[sbt] class CoursierLogger(logger: Logger) extends CacheLogger {
|
||||
override def downloadedArtifact(url: String, success: Boolean): Unit =
|
||||
logger.debug(s"downloaded $url")
|
||||
}
|
||||
|
||||
def publicationsSetting(packageConfigs: Seq[(Configuration, CConfiguration)]): Def.Setting[_] = {
|
||||
csrPublications := CoursierArtifactsTasks.coursierPublicationsTask(packageConfigs: _*).value
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue