From 6351c6cc8c3014fd1fbb8244e872c9e28773dad0 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 19 Oct 2016 15:30:27 +0200 Subject: Create dotty-lib.jar for run tests --- src/dotty/tools/dotc/config/PathResolver.scala | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 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 55d585e94..83d4c6933 100644 --- a/src/dotty/tools/dotc/config/PathResolver.scala +++ b/src/dotty/tools/dotc/config/PathResolver.scala @@ -46,7 +46,23 @@ object PathResolver { def classPathEnv = envOrElse("CLASSPATH", "") def sourcePathEnv = envOrElse("SOURCEPATH", "") - def javaBootClassPath = propOrElse("sun.boot.class.path", searchForBootClasspath) + def javaBootClassPath = + propOrElse("sun.boot.class.path", searchForBootClasspath) + .split(":") + .filterNot { jar => + // This classpath gets propagated to the compiled resources and as + // such needs to be purged of things that should not be on the + // compiled programs' classpath: + jar.contains("dotty-compiler") || + jar.contains("dotty-library") || + jar.contains("dotty-interfaces") || + // let's blacklist locally compiled classes: + jar.contains("dotty/library/target") || + jar.contains("dotty/interfaces/target") || + jar.contains("dotty/target/scala-2.11") + } + .mkString(":") + def javaExtDirs = propOrEmpty("java.ext.dirs") def scalaHome = propOrEmpty("scala.home") def scalaExtDirs = propOrEmpty("scala.ext.dirs") @@ -213,11 +229,11 @@ class PathResolver(implicit ctx: Context) { * - Otherwise, if CLASSPATH is set, it is that * - If neither of those, then "." is used. */ - def userClassPath = ( + def userClassPath = { if (!settings.classpath.isDefault) settings.classpath.value else sys.env.getOrElse("CLASSPATH", ".") - ) + } import context._ -- cgit v1.2.3