From 06a3d47ea9fd1b67b3acba9d115a16d18549e377 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 26 Oct 2016 16:19:35 +0200 Subject: Move sjs, make sure that partest compiles everything in dirs --- src/dotty/tools/dotc/config/PathResolver.scala | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/dotty/tools/dotc/config/PathResolver.scala') diff --git a/src/dotty/tools/dotc/config/PathResolver.scala b/src/dotty/tools/dotc/config/PathResolver.scala index 1f9ee7eec..14a44531a 100644 --- a/src/dotty/tools/dotc/config/PathResolver.scala +++ b/src/dotty/tools/dotc/config/PathResolver.scala @@ -46,18 +46,7 @@ object PathResolver { def classPathEnv = envOrElse("CLASSPATH", "") def sourcePathEnv = envOrElse("SOURCEPATH", "") - def javaBootClassPath = - propOrElse("sun.boot.class.path", searchForBootClasspath) - .split(":") - .filterNot { jar => - // let's blacklist locally compiled classes: - jar.contains("/dotty/library/target/classes") || - jar.contains("/dotty/library/target/scala-2.11/classes") || - jar.contains("/dotty/interfaces/target/classes") || - jar.contains("/dotty/target/scala-2.11/classes") || - jar.contains("/dotty/target/classes") - } - .mkString(":") + def javaBootClassPath = propOrElse("sun.boot.class.path", searchForBootClasspath) def javaExtDirs = propOrEmpty("java.ext.dirs") def scalaHome = propOrEmpty("scala.home") @@ -266,8 +255,15 @@ class PathResolver(implicit ctx: Context) { def containers = Calculated.containers lazy val result: JavaClassPath = { - val (dottyJars, others) = containers.partition(_.name.contains("dotty")) - val cp = new JavaClassPath((dottyJars ++ others).toIndexedSeq, context) + // Prioritize `dotty.jar` and `dotty-lib.jar` to shadow others + val (dottyJars, others) = + containers.partition(x => x.name.contains("dotty-lib.jar") || x.name.contains("dotty.jar")) + // Then any jars with `dotty` in the name - putting them before scala-library + val (dottyCp, remaining) = + others.partition(_.name.contains("dotty-")) + + val cp = new JavaClassPath((dottyJars ++ dottyCp ++ remaining).toIndexedSeq, context) + if (settings.Ylogcp.value) { Console.println("Classpath built from " + settings.toConciseString(ctx.sstate)) Console.println("Defaults: " + PathResolver.Defaults) -- cgit v1.2.3