From a398e7d78f12f226cc7ac67ea38190bee171b78d Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 27 Jul 2014 12:26:12 -0400 Subject: [PATCH] Implements eviction warning stories. #1200 This implements all stories from https://github.com/sbt/sbt/wiki/User-Stories%3A-Conflict-Warning. When scalaVersion is no longer effective an eviction warning will display. Scala version was updated by one of library dependencies: * org.scala-lang:scala-library:2.10.2 -> 2.10.3 When there're suspected incompatibility in directly depended Java libraries, eviction warnings will display. There may be incompatibilities among your library dependencies. Here are some of the libraries that were evicted: * commons-io:commons-io:1.4 -> 2.4 When there's suspected incompatiblity in directly depended Scala libraries, eviction warnings will display. There may be incompatibilities among your library dependencies. Here are some of the libraries that were evicted: * com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4 This also adds 'evicted' task, which displays more detailed eviction warnings. --- .../collection/src/main/scala/sbt/ShowLines.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 util/collection/src/main/scala/sbt/ShowLines.scala diff --git a/util/collection/src/main/scala/sbt/ShowLines.scala b/util/collection/src/main/scala/sbt/ShowLines.scala new file mode 100644 index 000000000..126b6360e --- /dev/null +++ b/util/collection/src/main/scala/sbt/ShowLines.scala @@ -0,0 +1,15 @@ +package sbt + +trait ShowLines[A] { + def showLines(a: A): Seq[String] +} +object ShowLines { + def apply[A](f: A => Seq[String]): ShowLines[A] = + new ShowLines[A] { + def showLines(a: A): Seq[String] = f(a) + } + + implicit class ShowLinesOp[A: ShowLines](a: A) { + def lines: Seq[String] = implicitly[ShowLines[A]].showLines(a) + } +}