diff --git a/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala b/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala index cccbfe801..2ec0e97f1 100644 --- a/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala +++ b/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala @@ -70,17 +70,7 @@ object EvictionWarningOptions { showCallers = false, defaultGuess ) - def default: EvictionWarningOptions = - new EvictionWarningOptions( - Vector(Compile), - warnScalaVersionEviction = true, - warnDirectEvictions = true, - warnTransitiveEvictions = true, - warnEvictionSummary = false, - infoAllEvictions = false, - showCallers = true, - defaultGuess - ) + def default: EvictionWarningOptions = summary def full: EvictionWarningOptions = new EvictionWarningOptions( Vector(Compile), diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala index ffc6e1f70..78669c178 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala @@ -88,7 +88,7 @@ class EvictionWarningSpec extends BaseIvySpecification { def akkaRemote234 = ModuleID("com.typesafe.akka", "akka-remote", "2.3.4").withConfigurations(Some("compile")) cross CrossVersion.binary // uses akka-actor 2.3.4 - def defaultOptions = EvictionWarningOptions.default + def fullOptions = EvictionWarningOptions.full import sbt.util.ShowLines._ @@ -97,19 +97,19 @@ class EvictionWarningSpec extends BaseIvySpecification { def scalaVersionWarn1() = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).scalaEvictions should have size (1) + EvictionWarning(m, fullOptions, report).scalaEvictions should have size (1) } def scalaVersionWarn2() = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false), report).scalaEvictions should have size (0) + EvictionWarning(m, fullOptions.withWarnScalaVersionEviction(false), report).scalaEvictions should have size (0) } def scalaVersionWarn3() = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withShowCallers(false), report).lines shouldBe + EvictionWarning(m, fullOptions.withShowCallers(false), report).lines shouldBe List( "Scala version was updated by one of library dependencies:", "\t* org.scala-lang:scala-library:2.10.3 is selected over 2.10.2", @@ -123,7 +123,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, report).lines shouldBe + EvictionWarning(m, fullOptions, report).lines shouldBe List( "Scala version was updated by one of library dependencies:", "\t* org.scala-lang:scala-library:2.10.3 is selected over 2.10.2", @@ -149,13 +149,13 @@ class EvictionWarningSpec extends BaseIvySpecification { def scalaVersionNoWarn1() = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).scalaEvictions should have size (0) + EvictionWarning(m, fullOptions, report).scalaEvictions should have size (0) } def scalaVersionNoWarn2() = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false), report).scalaEvictions should have size (0) + EvictionWarning(m, fullOptions.withWarnScalaVersionEviction(false), report).scalaEvictions should have size (0) } def javaLibDirectDeps = Vector(commonsIo14, commonsIo24) @@ -163,7 +163,7 @@ class EvictionWarningSpec extends BaseIvySpecification { def javaLibWarn1() = { val m = module(defaultModuleId, javaLibDirectDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).reportedEvictions should have size (1) + EvictionWarning(m, fullOptions, report).reportedEvictions should have size (1) } def javaLibWarn2() = { @@ -171,7 +171,7 @@ class EvictionWarningSpec extends BaseIvySpecification { val report = ivyUpdate(m) EvictionWarning( m, - defaultOptions + fullOptions .withWarnDirectEvictions(false) .withWarnTransitiveEvictions(false), report @@ -181,7 +181,7 @@ class EvictionWarningSpec extends BaseIvySpecification { def javaLibWarn3() = { val m = module(defaultModuleId, javaLibDirectDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).lines shouldBe + EvictionWarning(m, fullOptions, report).lines shouldBe List( "Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:", "", @@ -195,7 +195,7 @@ class EvictionWarningSpec extends BaseIvySpecification { def javaLibWarn4() = { val m = module(defaultModuleId, javaLibDirectDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withShowCallers(true), report).lines shouldBe + EvictionWarning(m, fullOptions.withShowCallers(true), report).lines shouldBe List( "Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:", "", @@ -220,14 +220,14 @@ class EvictionWarningSpec extends BaseIvySpecification { val deps = Vector(commonsIo14, commonsIo13) val m = module(defaultModuleId, deps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).reportedEvictions should have size (0) + EvictionWarning(m, fullOptions, report).reportedEvictions should have size (0) } def javaLibNoWarn2() = { val deps = Vector(commonsIo14, commonsIo13) val m = module(defaultModuleId, deps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).lines shouldBe Nil + EvictionWarning(m, fullOptions, report).lines shouldBe Nil } def javaLibTransitiveDeps = Vector(unfilteredUploads080, bnfparser10) @@ -235,13 +235,13 @@ class EvictionWarningSpec extends BaseIvySpecification { def javaLibTransitiveWarn2() = { val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).reportedEvictions should have size (1) + EvictionWarning(m, fullOptions, report).reportedEvictions should have size (1) } def javaLibTransitiveWarn3() = { val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).lines shouldBe + EvictionWarning(m, fullOptions, report).lines shouldBe List( "There may be incompatibilities among your library dependencies.", "Here are some of the libraries that were evicted:", @@ -253,14 +253,14 @@ class EvictionWarningSpec extends BaseIvySpecification { val deps = Vector(scala2104, akkaActor214, akkaActor234) val m = module(defaultModuleId, deps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).reportedEvictions should have size (1) + EvictionWarning(m, fullOptions, report).reportedEvictions should have size (1) } def scalaLibWarn2() = { val deps = Vector(scala2104, akkaActor214, akkaActor234) val m = module(defaultModuleId, deps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).lines shouldBe + EvictionWarning(m, fullOptions, report).lines shouldBe List( "Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:", "", @@ -286,14 +286,14 @@ class EvictionWarningSpec extends BaseIvySpecification { val deps = Vector(scala2104, akkaActor230, akkaActor234) val m = module(defaultModuleId, deps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).reportedEvictions should have size (0) + EvictionWarning(m, fullOptions, report).reportedEvictions should have size (0) } def scalaLibNoWarn2() = { val deps = Vector(scala2104, akkaActor230, akkaActor234) val m = module(defaultModuleId, deps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).lines shouldBe Nil + EvictionWarning(m, fullOptions, report).lines shouldBe Nil } def scalaLibTransitiveDeps = Vector(scala2104, bananaSesame04, akkaRemote234) @@ -301,13 +301,13 @@ class EvictionWarningSpec extends BaseIvySpecification { def scalaLibTransitiveWarn2() = { val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).reportedEvictions should have size (1) + EvictionWarning(m, fullOptions, report).reportedEvictions should have size (1) } def scalaLibTransitiveWarn3() = { val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report).lines shouldBe + EvictionWarning(m, fullOptions, report).lines shouldBe List( "Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:", "",