diff options
author | Paul Phillips <paulp@improving.org> | 2010-02-20 06:48:29 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-02-20 06:48:29 +0000 |
commit | 71e84137b68fc0cb0f9a616633bb39ef7c388fa4 (patch) | |
tree | 197d91bef658682a00247658ef621b0dd2dea423 | |
parent | ff32248e9a8dd8dd6ea55e502c15e2e8626148e0 (diff) | |
download | scala-71e84137b68fc0cb0f9a616633bb39ef7c388fa4.tar.gz scala-71e84137b68fc0cb0f9a616633bb39ef7c388fa4.tar.bz2 scala-71e84137b68fc0cb0f9a616633bb39ef7c388fa4.zip |
Altered the ant task to generate a -Dscala.home...
Altered the ant task to generate a -Dscala.home= property, which now
acts as signal to scalac to ignore the java classpath and use only the
scala classpath. No review.
-rw-r--r-- | src/compiler/scala/tools/ant/sabbus/ScalacFork.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/util/PathResolver.scala | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala index 20e410543e..50b9f12dcc 100644 --- a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala +++ b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala @@ -102,6 +102,10 @@ class ScalacFork extends MatchingTask with TaskArgs { java setClasspath compilerPath java setClassname MainClass + // if compilationPath is set, set -Dscala.home so the compilerPath is not + // used by scala + compilationPath foreach (_ => java.createJvmarg() setValue "-Dscala.home=") + // dump the arguments to a file and do "java @file" val tempArgFile = io.File.makeTemp("scalacfork") val tokens = settings.toArgs ++ (includedFiles map (_.getPath)) diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala index c86c6ffe74..aa73e02e53 100644 --- a/src/compiler/scala/tools/util/PathResolver.scala +++ b/src/compiler/scala/tools/util/PathResolver.scala @@ -59,6 +59,7 @@ object PathResolver { def scalaHome = propOrElse("scala.home", "") def scalaExtDirs = propOrElse("scala.ext.dirs", "") def scalaHomeGuessed = searchForScalaHome + def scalaHomeIsSet = System.getProperty("scala.home") != null override def toString = """ |object Environment { @@ -179,7 +180,7 @@ class PathResolver(settings: Settings, context: JavaContext) { def scalaHome = Defaults.scalaHome def javaBootClassPath = cmdLineOrElse("javabootclasspath", Defaults.javaBootClassPath) def javaExtDirs = cmdLineOrElse("javaextdirs", Defaults.javaExtDirs) - def javaUserClassPath = Defaults.javaUserClassPath + def javaUserClassPath = if (Environment.scalaHomeIsSet) "" else Defaults.javaUserClassPath def scalaBootClassPath = cmdLineOrElse("bootclasspath", Defaults.scalaBootClassPath) def scalaExtDirs = cmdLineOrElse("extdirs", Defaults.scalaExtDirs) def userClassPath = cmdLineOrElse("classpath", ".") |