Port project/global-plugin

This commit is contained in:
Eugene Yokota 2016-03-28 17:05:58 -04:00
parent f976c4b04f
commit c02b053c55
4 changed files with 16 additions and 22 deletions

View File

@ -1,21 +0,0 @@
import sbt._
import Import._
import sbt.Keys._
object MyBuild extends Build {
lazy val mySettings = Defaults.defaultSettings ++ Seq(
name := "my-test-proj",
organization := "com.example",
check <<= update map checkVersion,
version := "0.1.0-SNAPSHOT")
lazy val proj = Project("my-test-proj", file("."), settings = mySettings)
lazy val check = taskKey[Unit]("Verifies that the junit dependency has the newer version (4.8)")
def checkVersion(report: UpdateReport): Unit = {
for(mod <- report.allModules) {
if(mod.name == "junit") assert(mod.revision == "4.8", s"JUnit version (${mod.revision}) does not have the correct version")
}
}
}

View File

@ -0,0 +1,15 @@
lazy val check = taskKey[Unit]("Verifies that the junit dependency has the newer version (4.8)")
lazy val proj = (project in file(".")).
settings(
name := "my-test-proj",
organization := "com.example",
check <<= update map checkVersion,
version := "0.1.0-SNAPSHOT"
)
def checkVersion(report: UpdateReport): Unit = {
for(mod <- report.allModules) {
if(mod.name == "junit") assert(mod.revision == "4.8", s"JUnit version (${mod.revision}) does not have the correct version")
}
}

View File

@ -1,4 +1,4 @@
$ copy-file changes/Build.scala project/Build.scala
$ copy-file changes/build.sbt build.sbt
> reload
# ensure that a new global dependency gets picked up