mirror of https://github.com/sbt/sbt.git
Merge pull request #6327 from eed3si9n/wip/opt_in
integrate assumedVersionScheme and assumedEvictionErrorLevel
This commit is contained in:
commit
e4118fb053
|
|
@ -2785,6 +2785,9 @@ object Classpaths {
|
|||
libraryDependencies :== Nil,
|
||||
libraryDependencySchemes :== Nil,
|
||||
evictionErrorLevel :== Level.Error,
|
||||
assumedEvictionErrorLevel :== Level.Info,
|
||||
assumedVersionScheme :== VersionScheme.Always,
|
||||
assumedVersionSchemeJava :== VersionScheme.Always,
|
||||
excludeDependencies :== Nil,
|
||||
ivyLoggingLevel := (// This will suppress "Resolving..." logs on Jenkins and Travis.
|
||||
if (insideCI.value)
|
||||
|
|
@ -3592,6 +3595,9 @@ object Classpaths {
|
|||
uwConfig = (unresolvedWarningConfiguration in update).value,
|
||||
evictionLevel = evictionErrorLevel.value,
|
||||
versionSchemeOverrides = libraryDependencySchemes.value,
|
||||
assumedEvictionErrorLevel = assumedEvictionErrorLevel.value,
|
||||
assumedVersionScheme = assumedVersionScheme.value,
|
||||
assumedVersionSchemeJava = assumedVersionSchemeJava.value,
|
||||
mavenStyle = publishMavenStyle.value,
|
||||
compatWarning = compatibilityWarningOptions.value,
|
||||
includeCallers = includeCallers,
|
||||
|
|
|
|||
|
|
@ -458,7 +458,10 @@ object Keys {
|
|||
val updateFull = taskKey[UpdateReport]("Resolves and optionally retrieves dependencies, producing a full report with callers.").withRank(CTask)
|
||||
val evicted = taskKey[EvictionWarning]("Display detailed eviction warnings.").withRank(CTask)
|
||||
val evictionWarningOptions = settingKey[EvictionWarningOptions]("Options on eviction warnings after resolving managed dependencies.").withRank(DSetting)
|
||||
val evictionErrorLevel = settingKey[Level.Value]("The log level for detected eviction errors. Level.Error will throw an error.")
|
||||
val evictionErrorLevel = settingKey[Level.Value]("The log level for the detected eviction errors. Level.Error will throw an error.").withRank(DSetting)
|
||||
val assumedEvictionErrorLevel = settingKey[Level.Value]("The log level for the assumed eviction errors. Level.Error will throw an error.").withRank(DSetting)
|
||||
val assumedVersionScheme = settingKey[String]("The assumed version scheme of a Scala library when POM doesn't have versionScheme.").withRank(DSetting)
|
||||
val assumedVersionSchemeJava = settingKey[String]("The assumed version scheme of a Java library when POM doesn't have versionScheme.").withRank(DSetting)
|
||||
val transitiveUpdate = taskKey[Seq[UpdateReport]]("UpdateReports for the internal dependencies of this project.").withRank(DTask)
|
||||
val updateClassifiers = TaskKey[UpdateReport]("updateClassifiers", "Resolves and optionally retrieves classified artifacts, such as javadocs and sources, for dependency definitions, transitively.", BPlusTask, update)
|
||||
val transitiveClassifiers = settingKey[Seq[String]]("List of classifiers used for transitively obtaining extra artifacts for sbt or declared dependencies.").withRank(BSetting)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* sbt
|
||||
* Copyright 2011 - 2018, Lightbend, Inc.
|
||||
* Copyright 2008 - 2010, Mark Harrah
|
||||
* Licensed under Apache License 2.0 (see LICENSE)
|
||||
*/
|
||||
|
||||
package sbt
|
||||
|
||||
import sbt.internal.librarymanagement.VersionSchemes
|
||||
|
||||
object VersionScheme {
|
||||
val Always = VersionSchemes.Always
|
||||
val EarlySemVer = VersionSchemes.EarlySemVer
|
||||
val PVP = VersionSchemes.PackVer
|
||||
val SemVerSpec = VersionSchemes.SemVerSpec
|
||||
val Strict = VersionSchemes.Strict
|
||||
}
|
||||
|
|
@ -39,6 +39,9 @@ private[sbt] object LibraryManagement {
|
|||
uwConfig: UnresolvedWarningConfiguration,
|
||||
evictionLevel: Level.Value,
|
||||
versionSchemeOverrides: Seq[ModuleID],
|
||||
assumedEvictionErrorLevel: Level.Value,
|
||||
assumedVersionScheme: String,
|
||||
assumedVersionSchemeJava: String,
|
||||
mavenStyle: Boolean,
|
||||
compatWarning: CompatibilityWarningOptions,
|
||||
includeCallers: Boolean,
|
||||
|
|
@ -63,19 +66,33 @@ private[sbt] object LibraryManagement {
|
|||
val report1 = transform(report)
|
||||
|
||||
// Warn of any eviction and compatibility warnings
|
||||
val evictionError = EvictionError(report1, module, versionSchemeOverrides)
|
||||
if (evictionError.incompatibleEvictions.isEmpty) ()
|
||||
else
|
||||
evictionLevel match {
|
||||
case Level.Error =>
|
||||
val msgs = List(
|
||||
"",
|
||||
"this can be overridden using libraryDependencySchemes or evictionErrorLevel"
|
||||
)
|
||||
sys.error((evictionError.lines ++ msgs).mkString(EOL))
|
||||
case _ =>
|
||||
evictionError.lines.foreach(log.log(evictionLevel, _: String))
|
||||
}
|
||||
val evictionError = EvictionError(
|
||||
report1,
|
||||
module,
|
||||
versionSchemeOverrides,
|
||||
assumedVersionScheme,
|
||||
assumedVersionSchemeJava,
|
||||
assumedEvictionErrorLevel
|
||||
)
|
||||
def extraLines = List(
|
||||
"",
|
||||
"this can be overridden using libraryDependencySchemes or evictionErrorLevel"
|
||||
)
|
||||
val errorLines: Seq[String] =
|
||||
(if (evictionError.incompatibleEvictions.isEmpty
|
||||
|| evictionLevel != Level.Error) Nil
|
||||
else evictionError.lines) ++
|
||||
(if (evictionError.assumedIncompatibleEvictions.isEmpty
|
||||
|| assumedEvictionErrorLevel != Level.Error) Nil
|
||||
else evictionError.toAssumedLines)
|
||||
if (errorLines.nonEmpty) sys.error((errorLines ++ extraLines).mkString(EOL))
|
||||
else {
|
||||
if (evictionError.incompatibleEvictions.isEmpty) ()
|
||||
else evictionError.lines.foreach(log.log(evictionLevel, _: String))
|
||||
|
||||
if (evictionError.assumedIncompatibleEvictions.isEmpty) ()
|
||||
else evictionError.toAssumedLines.foreach(log.log(assumedEvictionErrorLevel, _: String))
|
||||
}
|
||||
CompatibilityWarning.run(compatWarning, module, mavenStyle, log)
|
||||
val report2 = transformDetails(report1, includeCallers, includeDetails)
|
||||
report2
|
||||
|
|
@ -272,6 +289,9 @@ private[sbt] object LibraryManagement {
|
|||
uwConfig = (unresolvedWarningConfiguration in update).value,
|
||||
evictionLevel = Level.Debug,
|
||||
versionSchemeOverrides = Nil,
|
||||
assumedEvictionErrorLevel = Level.Debug,
|
||||
assumedVersionScheme = VersionScheme.Always,
|
||||
assumedVersionSchemeJava = VersionScheme.Always,
|
||||
mavenStyle = publishMavenStyle.value,
|
||||
compatWarning = compatibilityWarningOptions.value,
|
||||
includeCallers = false,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ object Dependencies {
|
|||
// sbt modules
|
||||
private val ioVersion = nightlyVersion.getOrElse("1.5.0-M1")
|
||||
private val lmVersion =
|
||||
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.5.0-M5")
|
||||
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.5.0-M6")
|
||||
val zincVersion = nightlyVersion.getOrElse("1.5.0-M3")
|
||||
|
||||
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
|
|
|
|||
Loading…
Reference in New Issue