From 4219303cb85c5f892c548b129d6350a20df51518 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sun, 26 Nov 2017 13:58:24 -0800 Subject: Isolate TestRunner classloader to try and get AcyclicTests working... --- scalaplugin/src/main/scala/mill/scalaplugin/TestRunner.scala | 4 +++- scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'scalaplugin/src') diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/TestRunner.scala b/scalaplugin/src/main/scala/mill/scalaplugin/TestRunner.scala index 2d0495e4..09e41a74 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/TestRunner.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/TestRunner.scala @@ -43,7 +43,9 @@ object TestRunner { testClassfilePath: Seq[Path], args: Seq[String]): mill.eval.Result[Unit] = { val outerClassLoader = getClass.getClassLoader - val cl = new URLClassLoader(entireClasspath.map(_.toIO.toURI.toURL).toArray){ + val cl = new URLClassLoader( + entireClasspath.map(_.toIO.toURI.toURL).toArray, + ClassLoader.getSystemClassLoader().getParent()){ override def findClass(name: String) = { if (name.startsWith("sbt.testing.")){ outerClassLoader.loadClass(name) diff --git a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala index 97ca4d0b..0fc7d4af 100644 --- a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala +++ b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala @@ -21,7 +21,7 @@ object AcyclicBuild{ def version = "0.1.7" override def sources = basePath/'src/'main/'scala def scalaVersion = crossVersion - override def compileIvyDeps = Seq( + override def ivyDeps = Seq( Dep.Java("org.scala-lang", "scala-compiler", scalaVersion()) ) object test extends this.Tests{ @@ -91,7 +91,7 @@ object AcyclicTests extends TestSuite{ val Right((_, _)) = eval(AcyclicBuild.acyclic("2.12.4").compile) - // Tests can run +// Tests can run // val Right((_, _)) = eval(AcyclicBuild.acyclic("2.12.4").test.test()) } } -- cgit v1.2.3