Fix scripted tests and detect version automatically

This commit is contained in:
Johannes Rudolph 2017-10-06 11:43:27 +02:00
parent 00c3ab7da6
commit 05ee0e4f1d
No known key found for this signature in database
GPG Key ID: 52AF1C9ABD77E6E5
10 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,5 @@
ScriptedPlugin.scriptedSettings
ScriptedPlugin.scriptedLaunchOpts += s"-Dproject.version=${version.value}"
libraryDependencies ++= {
println(s"Evaluated ${sbtVersion in pluginCrossBuild value}")

View File

@ -5,7 +5,9 @@ libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % "1.0.7"
)
TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report, graph) =>
TaskKey[Unit]("check") := {
val report = (ivyReport in Test).value
val graph = (asciiTree in Test).value
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]

View File

@ -6,7 +6,10 @@ libraryDependencies ++= Seq(
"com.codahale" % "jerkson_2.9.1" % "0.5.0"
)
TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report, graph) =>
TaskKey[Unit]("check") := {
val report = (ivyReport in Test).value
val graph = (asciiTree in Test).value
def sanitize(str: String): String = str.split('\n').drop(1).map(_.trim).mkString("\n")
val expectedGraph =
"""default:default-dbc48d_2.9.2:0.1-SNAPSHOT [S]

View File

@ -1 +1 @@
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.3-SNAPSHOT")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % sys.props("project.version"))

View File

@ -3,7 +3,10 @@ scalaVersion := "2.9.2"
libraryDependencies +=
"at.blub" % "blib" % "1.2.3" % "test"
TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report, graph) =>
TaskKey[Unit]("check") := {
val report = (ivyReport in Test).value
val graph = (asciiTree in Test).value
def sanitize(str: String): String = str.split('\n').drop(1).mkString("\n")
val expectedGraph =
"""default:default-91180e_2.9.2:0.1-SNAPSHOT

View File

@ -27,7 +27,8 @@ object Build extends sbt.Build {
Project("test-dot-file-generation", file("d"))
.settings(defaultSettings: _*)
.settings(
TaskKey[Unit]("check") <<= (dependencyDot in Compile) map { (dotFile) =>
TaskKey[Unit]("check") := {
val dotFile = (dependencyDot in Compile).value
val expectedGraph =
"""digraph "dependency-graph" {
| graph[rankdir="LR"]