mirror of https://github.com/sbt/sbt.git
Merge pull request #3202 from eed3si9n/wip/eviction
change EvictionWarningOptions.default to include callers and transitives
This commit is contained in:
commit
0ca24b69a8
|
|
@ -47,11 +47,29 @@ final class EvictionWarningOptions private[sbt] (
|
|||
|
||||
object EvictionWarningOptions {
|
||||
def empty: EvictionWarningOptions =
|
||||
new EvictionWarningOptions(Vector(), false, false, false, false, false, defaultGuess)
|
||||
new EvictionWarningOptions(Vector(),
|
||||
warnScalaVersionEviction = false,
|
||||
warnDirectEvictions = false,
|
||||
warnTransitiveEvictions = false,
|
||||
infoAllEvictions = false,
|
||||
showCallers = false,
|
||||
defaultGuess)
|
||||
def default: EvictionWarningOptions =
|
||||
new EvictionWarningOptions(Vector(Compile), true, true, false, false, false, defaultGuess)
|
||||
new EvictionWarningOptions(Vector(Compile),
|
||||
warnScalaVersionEviction = true,
|
||||
warnDirectEvictions = true,
|
||||
warnTransitiveEvictions = true,
|
||||
infoAllEvictions = false,
|
||||
showCallers = true,
|
||||
defaultGuess)
|
||||
def full: EvictionWarningOptions =
|
||||
new EvictionWarningOptions(Vector(Compile), true, true, true, true, true, defaultGuess)
|
||||
new EvictionWarningOptions(Vector(Compile),
|
||||
warnScalaVersionEviction = true,
|
||||
warnDirectEvictions = true,
|
||||
warnTransitiveEvictions = true,
|
||||
infoAllEvictions = true,
|
||||
showCallers = true,
|
||||
defaultGuess)
|
||||
|
||||
lazy val defaultGuess: Function1[(ModuleID, Option[ModuleID], Option[IvyScala]), Boolean] =
|
||||
guessSecondSegment orElse guessSemVer orElse guessFalse
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
|
||||
Including two (suspect) transitively binary incompatible Java libraries to
|
||||
direct dependencies should
|
||||
be not detected as eviction $javaLibTransitiveWarn1
|
||||
be detected if it's enabled $javaLibTransitiveWarn2
|
||||
be detected as eviction $javaLibTransitiveWarn2
|
||||
print out message about the eviction if it's enabled $javaLibTransitiveWarn3
|
||||
|
||||
Including two (suspect) binary incompatible Scala libraries to
|
||||
|
|
@ -47,8 +46,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
|
||||
Including two (suspect) transitively binary incompatible Scala libraries to
|
||||
direct dependencies should
|
||||
be not detected as eviction $scalaLibTransitiveWarn1
|
||||
be detected if it's enabled $scalaLibTransitiveWarn2
|
||||
be detected as eviction $scalaLibTransitiveWarn2
|
||||
print out message about the eviction if it's enabled $scalaLibTransitiveWarn3
|
||||
"""
|
||||
|
||||
|
|
@ -87,7 +85,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
def scalaVersionWarn3 = {
|
||||
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||
EvictionWarning(m, defaultOptions.withShowCallers(false), report, log).lines must_==
|
||||
List("Scala version was updated by one of library dependencies:",
|
||||
"\t* org.scala-lang:scala-library:2.10.2 -> 2.10.3",
|
||||
"To force scalaVersion, add the following:",
|
||||
|
|
@ -98,7 +96,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
def scalaVersionWarn4 = {
|
||||
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions.withShowCallers(true), report, log).lines must_==
|
||||
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||
List("Scala version was updated by one of library dependencies:",
|
||||
"\t* org.scala-lang:scala-library:2.10.2 -> 2.10.3 (caller: com.typesafe.akka:akka-actor_2.10:2.3.0, com.example:foo:0.1.0)",
|
||||
"To force scalaVersion, add the following:",
|
||||
|
|
@ -114,7 +112,8 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
def scalaVersionWarn6 = {
|
||||
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false), report, log).scalaEvictions must have size (0)
|
||||
EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false),
|
||||
report, log).scalaEvictions must have size (0)
|
||||
}
|
||||
|
||||
def javaLibDirectDeps = Seq(commonsIo14, commonsIo24)
|
||||
|
|
@ -128,7 +127,10 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
def javaLibWarn2 = {
|
||||
val m = module(defaultModuleId, javaLibDirectDeps, Some("2.10.3"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions.withWarnDirectEvictions(false), report, log).reportedEvictions must have size (0)
|
||||
EvictionWarning(m, defaultOptions
|
||||
.withWarnDirectEvictions(false)
|
||||
.withWarnTransitiveEvictions(false),
|
||||
report, log).reportedEvictions must have size (0)
|
||||
}
|
||||
|
||||
def javaLibWarn3 = {
|
||||
|
|
@ -137,8 +139,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||
List("There may be incompatibilities among your library dependencies.",
|
||||
"Here are some of the libraries that were evicted:",
|
||||
"\t* commons-io:commons-io:1.4 -> 2.4",
|
||||
"Run 'evicted' to see detailed eviction warnings")
|
||||
"\t* commons-io:commons-io:1.4 -> 2.4 (caller: com.example:foo:0.1.0)")
|
||||
}
|
||||
|
||||
def javaLibWarn4 = {
|
||||
|
|
@ -166,22 +167,16 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
|
||||
def javaLibTransitiveDeps = Seq(unfilteredUploads080, bnfparser10)
|
||||
|
||||
def javaLibTransitiveWarn1 = {
|
||||
val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (0)
|
||||
}
|
||||
|
||||
def javaLibTransitiveWarn2 = {
|
||||
val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true), report, log).reportedEvictions must have size (1)
|
||||
EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (1)
|
||||
}
|
||||
|
||||
def javaLibTransitiveWarn3 = {
|
||||
val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true).withShowCallers(true), report, log).lines must_==
|
||||
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||
List("There may be incompatibilities among your library dependencies.",
|
||||
"Here are some of the libraries that were evicted:",
|
||||
"\t* commons-io:commons-io:1.4 -> 2.4 (caller: ca.gobits.bnf:bnfparser:1.0, net.databinder:unfiltered-uploads_2.10:0.8.0)")
|
||||
|
|
@ -201,8 +196,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||
List("There may be incompatibilities among your library dependencies.",
|
||||
"Here are some of the libraries that were evicted:",
|
||||
"\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4",
|
||||
"Run 'evicted' to see detailed eviction warnings")
|
||||
"\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4 (caller: com.example:foo:0.1.0)")
|
||||
}
|
||||
|
||||
def scalaLibNoWarn1 = {
|
||||
|
|
@ -221,22 +215,16 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
|||
|
||||
def scalaLibTransitiveDeps = Seq(scala2104, bananaSesame04, akkaRemote234)
|
||||
|
||||
def scalaLibTransitiveWarn1 = {
|
||||
val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (0)
|
||||
}
|
||||
|
||||
def scalaLibTransitiveWarn2 = {
|
||||
val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true), report, log).reportedEvictions must have size (1)
|
||||
EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (1)
|
||||
}
|
||||
|
||||
def scalaLibTransitiveWarn3 = {
|
||||
val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4"))
|
||||
val report = ivyUpdate(m)
|
||||
EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true).withShowCallers(true), report, log).lines must_==
|
||||
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||
List("There may be incompatibilities among your library dependencies.",
|
||||
"Here are some of the libraries that were evicted:",
|
||||
"\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4 (caller: com.typesafe.akka:akka-remote_2.10:2.3.4, org.w3:banana-sesame_2.10:0.4, org.w3:banana-rdf_2.10:0.4)")
|
||||
|
|
|
|||
|
|
@ -2151,16 +2151,18 @@ trait BuildExtra extends BuildCommon with DefExtra {
|
|||
def fullRunInputTask(scoped: InputKey[Unit], config: Configuration, mainClass: String, baseArguments: String*): Setting[InputTask[Unit]] =
|
||||
scoped := (inputTask { result =>
|
||||
(initScoped(scoped.scopedKey, runnerInit) zipWith (fullClasspath in config, streams, result).identityMap) { (rTask, t) =>
|
||||
(t, rTask) map { case ((cp, s, args), r) =>
|
||||
r.run(mainClass, data(cp), baseArguments ++ args, s.log) foreach sys.error
|
||||
(t, rTask) map {
|
||||
case ((cp, s, args), r) =>
|
||||
r.run(mainClass, data(cp), baseArguments ++ args, s.log) foreach sys.error
|
||||
}
|
||||
}
|
||||
}).evaluated
|
||||
def fullRunTask(scoped: TaskKey[Unit], config: Configuration, mainClass: String, arguments: String*): Setting[Task[Unit]] =
|
||||
scoped := ((initScoped(scoped.scopedKey, runnerInit) zipWith (fullClasspath in config, streams).identityMap) {
|
||||
case (rTask, t) =>
|
||||
(t, rTask) map { case ((cp, s), r) =>
|
||||
r.run(mainClass, data(cp), arguments, s.log) foreach sys.error
|
||||
(t, rTask) map {
|
||||
case ((cp, s), r) =>
|
||||
r.run(mainClass, data(cp), arguments, s.log) foreach sys.error
|
||||
}
|
||||
}).value
|
||||
def initScoped[T](sk: ScopedKey[_], i: Initialize[T]): Initialize[T] = initScope(fillTaskAxis(sk.scope, sk.key), i)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
sbt.version=0.13.12
|
||||
sbt.version=0.13.16-M1
|
||||
|
|
|
|||
|
|
@ -70,9 +70,12 @@ class JUnitXmlTestsListener(val outputDir: String) extends TestsListener {
|
|||
{
|
||||
for (e <- events) yield <testcase classname={ name } name={
|
||||
e.selector match {
|
||||
case selector: TestSelector => selector.testName.split('.').last
|
||||
case nested: NestedTestSelector => nested.suiteId().split('.').last + "." + nested.testName()
|
||||
case other => s"(It is not a test it is a ${other.getClass.getCanonicalName})"
|
||||
case selector: TestSelector =>
|
||||
selector.testName.split('.').last
|
||||
case nested: NestedTestSelector =>
|
||||
nested.suiteId().split('.').last + "." + nested.testName()
|
||||
case other =>
|
||||
s"(It is not a test it is a ${other.getClass.getCanonicalName})"
|
||||
}
|
||||
} time={ (e.duration() / 1000.0).toString }>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue