diff options
Diffstat (limited to 'scalaplugin')
-rw-r--r-- | scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala | 14 | ||||
-rw-r--r-- | scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala | 5 |
2 files changed, 15 insertions, 4 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala index 6b67b708..27aefb12 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala @@ -4,6 +4,7 @@ package scalaplugin import java.io.File import java.net.URLClassLoader import java.util.Optional +import java.util.concurrent.Callable import ammonite.ops._ import coursier.{Cache, Fetch, MavenRepository, Repository, Resolution} @@ -17,6 +18,8 @@ import sbt.internal.util.{ConsoleOut, MainAppender} import sbt.util.{InterfaceUtil, LogExchange} import xsbti.compile.{CompilerCache => _, FileAnalysisStore => _, ScalaInstance => _, _} import mill.util.JsonFormatters._ +import sbt.librarymanagement.DependencyResolution +import xsbti.GlobalLock @@ -49,7 +52,11 @@ object ScalaModule{ val outerClassLoader = getClass.getClassLoader val compilerJars = compilerClasspath.toArray.map(_.toIO) - val compilerBridgeJar = grepJar(compilerBridge, s"compiler-bridge_$binaryScalaVersion-1.0.5.jar") + + val compilerBridgeJar = new java.io.File( + s"bridge/${scalaVersion.replace('.', '_')}/target/scala-$binaryScalaVersion/mill-bridge_$scalaVersion-0.1-SNAPSHOT.jar" + ) + val zincClassLoader = new URLClassLoader(compilerJars.map(_.toURI.toURL), null){ override def loadClass(name: String): Class[_] = { Option(findLoadedClass(name)) orElse @@ -115,7 +122,8 @@ object ScalaModule{ lookup, skip = false, zincFile, - compilerCache, + new FreshCompilerCache, +// compilerCache, IncOptions.of(), reporter, Some(ignoreProgress), @@ -129,6 +137,8 @@ object ScalaModule{ logger = logger ) + zincClassLoader.close() + store.set( AnalysisContents.create( newResult.analysis(), diff --git a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala index 7ba8b267..124c7a0c 100644 --- a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala +++ b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala @@ -9,7 +9,7 @@ import utest._ import mill.util.JsonFormatters._ object AcyclicBuild{ val acyclic = - for(crossVersion <- Cross("2.10.6", "2.11.8", "2.12.4")) + for(crossVersion <- Cross("2.10.6", "2.11.8", "2.12.3", "2.12.4")) yield new ScalaModule{outer => def basePath = AcyclicTests.workspacePath def organization = "com.lihaoyi" @@ -46,7 +46,8 @@ object AcyclicTests extends TestSuite{ 'scala210 - check("2.10.6") 'scala211 - check("2.11.8") - 'scala212 - check("2.12.4") + 'scala2123 - check("2.12.3") + 'scala2124 - check("2.12.4") val allBinaryVersions = Seq("2.10", "2.11", "2.12") def check(scalaVersion: String) = { |