summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-04-09 22:16:27 -0700
committerLi Haoyi <haoyi.sg@gmail.com>2018-04-09 22:51:42 -0700
commitf79e9bbad7aefd9aeea89fd4c456b1eb447917db (patch)
treefc52e1452f359a1b09b39b8650aec29a07373b95 /build.sc
parent8bd438bf84c1b221bcc122b3abe5d4ec37495071 (diff)
downloadmill-f79e9bbad7aefd9aeea89fd4c456b1eb447917db.tar.gz
mill-f79e9bbad7aefd9aeea89fd4c456b1eb447917db.tar.bz2
mill-f79e9bbad7aefd9aeea89fd4c456b1eb447917db.zip
- Swap client-server integer encoding over to a more standard format (32-bit)
- Unit tests for client code using the new Java support - Make server auto-shutdown when the client version changes, to avoid stale-server confusion
Diffstat (limited to 'build.sc')
-rwxr-xr-xbuild.sc17
1 files changed, 14 insertions, 3 deletions
diff --git a/build.sc b/build.sc
index 5cc31efc..413689a4 100755
--- a/build.sc
+++ b/build.sc
@@ -71,6 +71,10 @@ object client extends MillPublishModule{
"net.java.dev.jna" -> "jna-platform"
)
)
+ object test extends Tests{
+ def testFrameworks = Seq("com.novocode.junit.JUnitFramework")
+ def ivyDeps = Agg(ivy"com.novocode:junit-interface:0.11")
+ }
}
@@ -111,7 +115,9 @@ object main extends MillModule {
def generatedSources = T {
Seq(PathRef(shared.generateCoreSources(T.ctx().dest)))
}
-
+ def testArgs = Seq(
+ "-DMILL_VERSION=" + build.publishVersion()._2,
+ )
val test = new Tests(implicitly)
class Tests(ctx0: mill.define.Ctx) extends super.Tests(ctx0){
def generatedSources = T {
@@ -293,7 +299,7 @@ object dev extends MillModule{
scalaworker.testArgs() ++
// Workaround for Zinc/JNA bug
// https://github.com/sbt/sbt/blame/6718803ee6023ab041b045a6988fafcfae9d15b5/main/src/main/scala/sbt/Main.scala#L130
- Seq("-Djna.nosys=true")
+ Seq("-Djna.nosys=true", "-DMILL_VERSION=" + build.publishVersion()._2)
def launcher = T{
val isWin = scala.util.Properties.isWin
@@ -379,6 +385,11 @@ def publishVersion = T.input{
)
catch{case e => None}
+ val dirtySuffix = %%('git, 'diff)(pwd).out.string.trim() match{
+ case "" => ""
+ case s => "-DIRTY" + Integer.toHexString(s.hashCode)
+ }
+
tag match{
case Some(t) => (t, t)
case None =>
@@ -388,7 +399,7 @@ def publishVersion = T.input{
%%('git, "rev-list", gitHead(), "--count")(pwd).out.trim.toInt -
%%('git, "rev-list", latestTaggedVersion, "--count")(pwd).out.trim.toInt
- (latestTaggedVersion, s"$latestTaggedVersion-$commitsSinceLastTag-${gitHead().take(6)}")
+ (latestTaggedVersion, s"$latestTaggedVersion-$commitsSinceLastTag-${gitHead().take(6)}$dirtySuffix")
}
}