Changed the way in which the path to javac is passed to partest.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@16307 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
phaller 2008-10-21 19:04:52 +00:00
parent b31649fbca
commit af19a1fdda
8 changed files with 22 additions and 15 deletions

View File

@ -131,6 +131,8 @@ PROPERTIES
<property name="scalacfork.maxmemory" value="512m"/>
<property name="javac.cmd" value="${env.JAVA_HOME}/bin/javac"/>
<!-- ===========================================================================
INITIALISATION
============================================================================ -->
@ -997,7 +999,7 @@ BOOTRAPING TEST AND TEST SUITE
<target name="test.suite" depends="pack.done">
<partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java"
timeout="1200000">
timeout="1200000" javaccmd="${javac.cmd}">
<classpath>
<path refid="pack.classpath"/>
<fileset dir="${test.dir}/files/lib" includes="*.jar"/>

View File

@ -63,7 +63,10 @@ class PartestTask extends Task {
def setJavaCmd(input: File): Unit =
javacmd = Some(input)
def setJavacCmd(input: File): Unit =
javaccmd = Some(input)
def setScalacOpts(opts: String): Unit =
scalacOpts = Some(opts)
@ -72,6 +75,7 @@ class PartestTask extends Task {
private var classpath: Option[Path] = None
private var javacmd: Option[File] = None
private var javaccmd: Option[File] = None
private var showDiff: Boolean = false
private var showLog: Boolean = false
private var runFailed: Boolean = false
@ -194,6 +198,8 @@ class PartestTask extends Task {
setFileManagerBooleanProperty("failed", runFailed)
if (!javacmd.isEmpty)
setFileManagerStringProperty("JAVACMD", javacmd.get.getAbsolutePath)
if (!javaccmd.isEmpty)
setFileManagerStringProperty("JAVAC_CMD", javaccmd.get.getAbsolutePath)
setFileManagerStringProperty("CLASSPATH", classpath.get.list.mkString(File.pathSeparator))
setFileManagerStringProperty("LATEST_LIB", scalaLibrary.get.getAbsolutePath)
if (!scalacOpts.isEmpty)

View File

@ -23,7 +23,7 @@ class AntRunner extends DirectRunner {
val fileManager = new FileManager {
var JAVACMD: String = "java"
var JAVAC_CMD: String = "javac"
var CLASSPATH: String = _
var EXT_CLASSPATH: String = _
var LATEST_LIB: String = _

View File

@ -43,6 +43,8 @@ class ConsoleFileManager extends FileManager {
NestUI.verbose("CLASSPATH: "+CLASSPATH)
var JAVACMD = System.getProperty("scalatest.javacmd", "java")
var JAVAC_CMD = System.getProperty("scalatest.javac_cmd", "javac")
val prefixFile = {
val cwd = System.getProperty("user.dir")
if (cwd != null)

View File

@ -50,7 +50,8 @@ trait FileManager {
var JAVACMD: String
var JAVAC_CMD: String
var CLASSPATH: String
var LATEST_LIB: String
var LIB_DIR: String = ""

View File

@ -167,16 +167,12 @@ class Worker(val fileManager: FileManager) extends Actor {
def javac(outDir: File, files: List[File], output: File) {
// compile using command-line javac compiler
val javaHome = System.getenv("JAVA_HOME")
NestUI.verbose("JAVA_HOME: "+javaHome)
val javacCmd = if (javaHome == null) {
// assume the compiler is in the PATH
val javacCmd = if ((fileManager.JAVAC_CMD.indexOf("${env.JAVA_HOME}") != -1) ||
fileManager.JAVAC_CMD.equals("/bin/javac") ||
fileManager.JAVAC_CMD.equals("\\bin\\javac"))
"javac"
} else {
// otherwise use the location suggested by JAVA_HOME
val sep = File.separator
javaHome + sep + "bin" + sep + "javac"
}
else
fileManager.JAVAC_CMD
val cmd = javacCmd+
" -d "+outDir.getAbsolutePath+

View File

@ -74,4 +74,4 @@ fi
[ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xmx256M -Xms16M"
[ -n "$SCALAC_OPTS" ] || SCALAC_OPTS="-deprecation"
${JAVACMD:=java} $JAVA_OPTS -cp "$EXT_CLASSPATH" -Dpartest.debug="${PARTEST_DEBUG}" -Dscala.home="${SCALA_HOME}" -Dscalatest.javacmd="${JAVACMD}" -Dscalatest.java_opts="${JAVA_OPTS}" -Dscalatest.scalac_opts="${SCALAC_OPTS}" scala.tools.partest.nest.NestRunner "$@"
${JAVACMD:=java} $JAVA_OPTS -cp "$EXT_CLASSPATH" -Dpartest.debug="${PARTEST_DEBUG}" -Dscala.home="${SCALA_HOME}" -Dscalatest.javacmd="${JAVACMD}" -Dscalatest.java_opts="${JAVA_OPTS}" -Dscalatest.scalac_opts="${SCALAC_OPTS}" -Dscalatest.javac_cmd="${JAVA_HOME}/bin/javac" scala.tools.partest.nest.NestRunner "$@"

View File

@ -53,7 +53,7 @@ if "%_EXTENSION_CLASSPATH%"=="" (
)
)
set _PROPS=-Dscala.home="%_SCALA_HOME%" -Dscalatest.javacmd="%_JAVACMD%" -Dscalatest.java_options="%_JAVA_OPTS%" -Dscalatest.scalac_options="%_SCALAC_OPTS%"
set _PROPS=-Dscala.home="%_SCALA_HOME%" -Dscalatest.javacmd="%_JAVACMD%" -Dscalatest.java_options="%_JAVA_OPTS%" -Dscalatest.scalac_options="%_SCALAC_OPTS%" -Dscalatest.javac_cmd="%JAVA_HOME%\bin\javac"
rem echo %_JAVACMD% %_JAVA_OPTS% %_PROPS% -cp "%_EXTENSION_CLASSPATH%" scala.tools.partest.nest.NestRunner %_ARGS%
%_JAVACMD% %_JAVA_OPTS% %_PROPS% -cp "%_EXTENSION_CLASSPATH%" scala.tools.partest.nest.NestRunner %_ARGS%