diff --git a/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/build.sbt b/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/build.sbt new file mode 100644 index 000000000..283f1ba13 --- /dev/null +++ b/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/build.sbt @@ -0,0 +1,29 @@ +import net.virtualvoid.sbt.graph.Plugin._ + +graphSettings + +scalaVersion := "2.9.2" + +libraryDependencies ++= Seq( + "org.slf4j" % "slf4j-api" % "1.7.2", + "ch.qos.logback" % "logback-classic" % "1.0.7", + "com.typesafe.akka" % "akka-actor" % "2.0.3") + +TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report, graph) => + def sanitize(str: String): String = str.split('\n').drop(1).map(_.trim).mkString("\n") + val expectedGraph = + """default:default-e95e05_2.9.2:0.1-SNAPSHOT [S] + | +-ch.qos.logback:logback-classic:1.0.7 + | | +-ch.qos.logback:logback-core:1.0.7 + | | +-org.slf4j:slf4j-api:1.6.6 (evicted by: 1.7.2) + | | + | +-com.typesafe.akka:akka-actor:2.0.3 [S] + | | +-com.typesafe:config:0.3.1 + | | + | +-org.slf4j:slf4j-api:1.7.2 + | """.stripMargin + IO.writeLines(file("/tmp/blib"), sanitize(graph).split("\n")) + IO.writeLines(file("/tmp/blub"), sanitize(expectedGraph).split("\n")) + require(sanitize(graph) == sanitize(expectedGraph), "Graph for report %s was '\n%s' but should have been '\n%s'" format (report, sanitize(graph), sanitize(expectedGraph))) + () +} diff --git a/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/project/plugins.sbt b/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/project/plugins.sbt new file mode 120000 index 000000000..0caf1de77 --- /dev/null +++ b/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/project/plugins.sbt @@ -0,0 +1 @@ +../../plugins.sbt \ No newline at end of file diff --git a/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/test b/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/test new file mode 100644 index 000000000..a5912a391 --- /dev/null +++ b/src/sbt-test/sbt-dependency-graph/ignoreScalaLibrary/test @@ -0,0 +1 @@ +> check \ No newline at end of file diff --git a/src/sbt-test/sbt-dependency-graph/plugins.sbt b/src/sbt-test/sbt-dependency-graph/plugins.sbt new file mode 100644 index 000000000..e25ce12a6 --- /dev/null +++ b/src/sbt-test/sbt-dependency-graph/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.0-RC3") \ No newline at end of file diff --git a/src/sbt-test/sbt-dependency-graph/showMissingUpdates/build.sbt b/src/sbt-test/sbt-dependency-graph/showMissingUpdates/build.sbt index 213719040..232b18d22 100644 --- a/src/sbt-test/sbt-dependency-graph/showMissingUpdates/build.sbt +++ b/src/sbt-test/sbt-dependency-graph/showMissingUpdates/build.sbt @@ -12,7 +12,6 @@ TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report, val expectedGraph = """default:default-91180e_2.9.2:0.1-SNAPSHOT | +-%sat.blub:blib:1.2.3 (error: not found)%s - | +-org.scala-lang:scala-library:2.9.2 | """.stripMargin.format(scala.Console.RED, scala.Console.RESET) require(sanitize(graph) == sanitize(expectedGraph), "Graph for report %s was '\n%s' but should have been '\n%s'" format (report, sanitize(graph), sanitize(expectedGraph))) () diff --git a/src/sbt-test/sbt-dependency-graph/showMissingUpdates/project/plugins.sbt b/src/sbt-test/sbt-dependency-graph/showMissingUpdates/project/plugins.sbt deleted file mode 100644 index 08b3f3d0a..000000000 --- a/src/sbt-test/sbt-dependency-graph/showMissingUpdates/project/plugins.sbt +++ /dev/null @@ -1 +0,0 @@ -addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.6.1-SNAPSHOT") \ No newline at end of file