summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-12-04 10:17:25 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2017-12-04 10:17:25 -0800
commita9ed3b67cc1d0b0a755159013b28766f436e866a (patch)
tree443b7c785359905983640499df724f75a53aee10 /build.sc
parent7238d7340744a5eda74acb6970c2cbf7bedea0e7 (diff)
downloadmill-a9ed3b67cc1d0b0a755159013b28766f436e866a.tar.gz
mill-a9ed3b67cc1d0b0a755159013b28766f436e866a.tar.bz2
mill-a9ed3b67cc1d0b0a755159013b28766f436e866a.zip
Flesh out `bridges` pre-compilation in Mill build, getting the cross-minor-version `AcyclicTests` running using the `mill` test runner
Fixed `Discovered` to only pick up public `Target`s, which makes it skip things like the `super$compile` of an overriden `compile` target. Split up `sources` and `allSources` TBD how to properly switch the `compilerBridgeJar` between the different output paths of SBT's compile-dir and Mill's compile-dir, and eventually to a maven-central artifact too
Diffstat (limited to 'build.sc')
-rwxr-xr-xbuild.sc35
1 files changed, 35 insertions, 0 deletions
diff --git a/build.sc b/build.sc
index 6eb3de2b..7b261892 100755
--- a/build.sc
+++ b/build.sc
@@ -48,10 +48,45 @@ object Core extends MillModule {
}
}
+
+val bridges = for{
+ crossVersion <- mill.define.Cross("2.10.6", "2.11.8", "2.11.11", "2.12.3", "2.12.4")
+} yield new ScalaModule{
+ def basePath = pwd / 'bridge
+ def scalaVersion = crossVersion
+ override def allSources = T{
+
+ val v = crossVersion.split('.').dropRight(1).mkString(".")
+ val url =
+ s"http://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_$v/1.0.5/compiler-bridge_$v-1.0.5-sources.jar"
+ val curlDest = T.ctx().dest
+ implicit val pwd = curlDest
+ mkdir(curlDest)
+ rm(curlDest/"bridge.jar")
+
+ %("curl", "-L", "-o", curlDest / "bridge.jar", url)
+ %("unzip", curlDest / "bridge.jar" , "-d", curlDest / 'classes)
+
+
+ Seq(PathRef(curlDest / 'classes))
+ }
+ override def ivyDeps = Seq(
+ Dep.Java("org.scala-lang", "scala-compiler", crossVersion),
+ Dep.Java("org.scala-sbt", "compiler-interface", "1.0.5")
+ )
+}
object ScalaPlugin extends MillModule {
override def projectDeps = Seq(Core)
def basePath = pwd / 'scalaplugin
+ override def compile = T.persistent[mill.eval.PathRef]{
+ bridges("2.10.6").compile()
+ bridges("2.11.8").compile()
+ bridges("2.11.11").compile()
+ bridges("2.12.3").compile()
+ bridges("2.12.4").compile()
+ super.compile()
+ }
override def prependShellScript =
"#!/usr/bin/env sh\n" +
"""exec java $JAVA_OPTS -cp "$0" mill.Main "$@" """