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 {
|
object EvictionWarningOptions {
|
||||||
def empty: 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 =
|
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 =
|
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] =
|
lazy val defaultGuess: Function1[(ModuleID, Option[ModuleID], Option[IvyScala]), Boolean] =
|
||||||
guessSecondSegment orElse guessSemVer orElse guessFalse
|
guessSecondSegment orElse guessSemVer orElse guessFalse
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
|
|
||||||
Including two (suspect) transitively binary incompatible Java libraries to
|
Including two (suspect) transitively binary incompatible Java libraries to
|
||||||
direct dependencies should
|
direct dependencies should
|
||||||
be not detected as eviction $javaLibTransitiveWarn1
|
be detected as eviction $javaLibTransitiveWarn2
|
||||||
be detected if it's enabled $javaLibTransitiveWarn2
|
|
||||||
print out message about the eviction if it's enabled $javaLibTransitiveWarn3
|
print out message about the eviction if it's enabled $javaLibTransitiveWarn3
|
||||||
|
|
||||||
Including two (suspect) binary incompatible Scala libraries to
|
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
|
Including two (suspect) transitively binary incompatible Scala libraries to
|
||||||
direct dependencies should
|
direct dependencies should
|
||||||
be not detected as eviction $scalaLibTransitiveWarn1
|
be detected as eviction $scalaLibTransitiveWarn2
|
||||||
be detected if it's enabled $scalaLibTransitiveWarn2
|
|
||||||
print out message about the eviction if it's enabled $scalaLibTransitiveWarn3
|
print out message about the eviction if it's enabled $scalaLibTransitiveWarn3
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -87,7 +85,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
def scalaVersionWarn3 = {
|
def scalaVersionWarn3 = {
|
||||||
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
|
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
|
||||||
val report = ivyUpdate(m)
|
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:",
|
List("Scala version was updated by one of library dependencies:",
|
||||||
"\t* org.scala-lang:scala-library:2.10.2 -> 2.10.3",
|
"\t* org.scala-lang:scala-library:2.10.2 -> 2.10.3",
|
||||||
"To force scalaVersion, add the following:",
|
"To force scalaVersion, add the following:",
|
||||||
|
|
@ -98,7 +96,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
def scalaVersionWarn4 = {
|
def scalaVersionWarn4 = {
|
||||||
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
|
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
|
||||||
val report = ivyUpdate(m)
|
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:",
|
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)",
|
"\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:",
|
"To force scalaVersion, add the following:",
|
||||||
|
|
@ -114,7 +112,8 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
def scalaVersionWarn6 = {
|
def scalaVersionWarn6 = {
|
||||||
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
|
val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
|
||||||
val report = ivyUpdate(m)
|
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)
|
def javaLibDirectDeps = Seq(commonsIo14, commonsIo24)
|
||||||
|
|
@ -128,7 +127,10 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
def javaLibWarn2 = {
|
def javaLibWarn2 = {
|
||||||
val m = module(defaultModuleId, javaLibDirectDeps, Some("2.10.3"))
|
val m = module(defaultModuleId, javaLibDirectDeps, Some("2.10.3"))
|
||||||
val report = ivyUpdate(m)
|
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 = {
|
def javaLibWarn3 = {
|
||||||
|
|
@ -137,8 +139,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||||
List("There may be incompatibilities among your library dependencies.",
|
List("There may be incompatibilities among your library dependencies.",
|
||||||
"Here are some of the libraries that were evicted:",
|
"Here are some of the libraries that were evicted:",
|
||||||
"\t* commons-io:commons-io:1.4 -> 2.4",
|
"\t* commons-io:commons-io:1.4 -> 2.4 (caller: com.example:foo:0.1.0)")
|
||||||
"Run 'evicted' to see detailed eviction warnings")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def javaLibWarn4 = {
|
def javaLibWarn4 = {
|
||||||
|
|
@ -166,22 +167,16 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
|
|
||||||
def javaLibTransitiveDeps = Seq(unfilteredUploads080, bnfparser10)
|
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 = {
|
def javaLibTransitiveWarn2 = {
|
||||||
val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3"))
|
val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3"))
|
||||||
val report = ivyUpdate(m)
|
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 = {
|
def javaLibTransitiveWarn3 = {
|
||||||
val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3"))
|
val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3"))
|
||||||
val report = ivyUpdate(m)
|
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.",
|
List("There may be incompatibilities among your library dependencies.",
|
||||||
"Here are some of the libraries that were evicted:",
|
"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)")
|
"\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_==
|
EvictionWarning(m, defaultOptions, report, log).lines must_==
|
||||||
List("There may be incompatibilities among your library dependencies.",
|
List("There may be incompatibilities among your library dependencies.",
|
||||||
"Here are some of the libraries that were evicted:",
|
"Here are some of the libraries that were evicted:",
|
||||||
"\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4",
|
"\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4 (caller: com.example:foo:0.1.0)")
|
||||||
"Run 'evicted' to see detailed eviction warnings")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def scalaLibNoWarn1 = {
|
def scalaLibNoWarn1 = {
|
||||||
|
|
@ -221,22 +215,16 @@ class EvictionWarningSpec extends BaseIvySpecification {
|
||||||
|
|
||||||
def scalaLibTransitiveDeps = Seq(scala2104, bananaSesame04, akkaRemote234)
|
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 = {
|
def scalaLibTransitiveWarn2 = {
|
||||||
val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4"))
|
val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4"))
|
||||||
val report = ivyUpdate(m)
|
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 = {
|
def scalaLibTransitiveWarn3 = {
|
||||||
val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4"))
|
val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4"))
|
||||||
val report = ivyUpdate(m)
|
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.",
|
List("There may be incompatibilities among your library dependencies.",
|
||||||
"Here are some of the libraries that were evicted:",
|
"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)")
|
"\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]] =
|
def fullRunInputTask(scoped: InputKey[Unit], config: Configuration, mainClass: String, baseArguments: String*): Setting[InputTask[Unit]] =
|
||||||
scoped := (inputTask { result =>
|
scoped := (inputTask { result =>
|
||||||
(initScoped(scoped.scopedKey, runnerInit) zipWith (fullClasspath in config, streams, result).identityMap) { (rTask, t) =>
|
(initScoped(scoped.scopedKey, runnerInit) zipWith (fullClasspath in config, streams, result).identityMap) { (rTask, t) =>
|
||||||
(t, rTask) map { case ((cp, s, args), r) =>
|
(t, rTask) map {
|
||||||
r.run(mainClass, data(cp), baseArguments ++ args, s.log) foreach sys.error
|
case ((cp, s, args), r) =>
|
||||||
|
r.run(mainClass, data(cp), baseArguments ++ args, s.log) foreach sys.error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).evaluated
|
}).evaluated
|
||||||
def fullRunTask(scoped: TaskKey[Unit], config: Configuration, mainClass: String, arguments: String*): Setting[Task[Unit]] =
|
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) {
|
scoped := ((initScoped(scoped.scopedKey, runnerInit) zipWith (fullClasspath in config, streams).identityMap) {
|
||||||
case (rTask, t) =>
|
case (rTask, t) =>
|
||||||
(t, rTask) map { case ((cp, s), r) =>
|
(t, rTask) map {
|
||||||
r.run(mainClass, data(cp), arguments, s.log) foreach sys.error
|
case ((cp, s), r) =>
|
||||||
|
r.run(mainClass, data(cp), arguments, s.log) foreach sys.error
|
||||||
}
|
}
|
||||||
}).value
|
}).value
|
||||||
def initScoped[T](sk: ScopedKey[_], i: Initialize[T]): Initialize[T] = initScope(fillTaskAxis(sk.scope, sk.key), i)
|
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={
|
for (e <- events) yield <testcase classname={ name } name={
|
||||||
e.selector match {
|
e.selector match {
|
||||||
case selector: TestSelector => selector.testName.split('.').last
|
case selector: TestSelector =>
|
||||||
case nested: NestedTestSelector => nested.suiteId().split('.').last + "." + nested.testName()
|
selector.testName.split('.').last
|
||||||
case other => s"(It is not a test it is a ${other.getClass.getCanonicalName})"
|
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 }>
|
} time={ (e.duration() / 1000.0).toString }>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue