summaryrefslogtreecommitdiff
path: root/scalaworker
diff options
context:
space:
mode:
authorNikolay Tatarinov <5min4eq.unity@gmail.com>2018-03-20 18:20:38 +0300
committerGitHub <noreply@github.com>2018-03-20 18:20:38 +0300
commitcb30f1c42c818b2a2b1e216823ca09c8430da5f9 (patch)
treed1f7e50547ab10c28bff562924a53c31a86e728c /scalaworker
parent672642e4694088c2c0aee6e408de079318bcd4db (diff)
downloadmill-cb30f1c42c818b2a2b1e216823ca09c8430da5f9.tar.gz
mill-cb30f1c42c818b2a2b1e216823ca09c8430da5f9.tar.bz2
mill-cb30f1c42c818b2a2b1e216823ca09c8430da5f9.zip
Support scala milestone releases (with fixes for 2.13.0-M3) (#247)
* return full scala version for milestone releases * complete support for scala 2.13.0-M2 * match 2.13 milestone releases for compiler bridge sources * add hello world test case for scala 2.13.0-M3
Diffstat (limited to 'scalaworker')
-rw-r--r--scalaworker/src/mill/scalaworker/ScalaWorker.scala12
1 files changed, 4 insertions, 8 deletions
diff --git a/scalaworker/src/mill/scalaworker/ScalaWorker.scala b/scalaworker/src/mill/scalaworker/ScalaWorker.scala
index c7aa4cd5..f26c98b3 100644
--- a/scalaworker/src/mill/scalaworker/ScalaWorker.scala
+++ b/scalaworker/src/mill/scalaworker/ScalaWorker.scala
@@ -87,7 +87,7 @@ class ScalaWorker(ctx0: mill.util.Ctx,
@volatile var scalaInstanceCache = Option.empty[(Long, ScalaInstance)]
def compileZincBridge(scalaVersion: String,
- compileBridgeSources: Agg[Path],
+ sourcesJar: Path,
compilerJars: Array[File]) = {
val workingDir = ctx0.dest / scalaVersion
val compiledDest = workingDir / 'compiled
@@ -98,11 +98,7 @@ class ScalaWorker(ctx0: mill.util.Ctx,
mkdir(workingDir)
mkdir(compiledDest)
- val sourceJar = compileBridgeSources
- .find(_.last == s"compiler-bridge_${Lib.scalaBinaryVersion(scalaVersion)}-1.1.0-sources.jar")
- .get
-
- val sourceFolder = mill.modules.Util.unpackZip(sourceJar)(workingDir)
+ val sourceFolder = mill.modules.Util.unpackZip(sourcesJar)(workingDir)
val classloader = mill.util.ClassLoader.create(compilerJars.map(_.toURI.toURL), null)(ctx0)
val scalacMain = classloader.loadClass("scala.tools.nsc.Main")
val argsArray = Array[String](
@@ -137,7 +133,7 @@ class ScalaWorker(ctx0: mill.util.Ctx,
def compileScala(scalaVersion: String,
sources: Agg[Path],
- compileBridgeSources: Agg[Path],
+ compilerBridgeSources: Path,
compileClasspath: Agg[Path],
compilerClasspath: Agg[Path],
scalacOptions: Seq[String],
@@ -148,7 +144,7 @@ class ScalaWorker(ctx0: mill.util.Ctx,
val compileClasspathFiles = compileClasspath.map(_.toIO).toArray
val compilerJars = compilerClasspath.toArray.map(_.toIO)
- val compilerBridge = compileZincBridge(scalaVersion, compileBridgeSources, compilerJars)
+ val compilerBridge = compileZincBridge(scalaVersion, compilerBridgeSources, compilerJars)
val pluginJars = scalacPluginClasspath.toArray.map(_.toIO)