From cb30f1c42c818b2a2b1e216823ca09c8430da5f9 Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov <5min4eq.unity@gmail.com> Date: Tue, 20 Mar 2018 18:20:38 +0300 Subject: 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 --- scalaworker/src/mill/scalaworker/ScalaWorker.scala | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'scalaworker') 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) -- cgit v1.2.3