diff options
author | Philipp Haller <hallerp@gmail.com> | 2008-02-06 15:09:54 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2008-02-06 15:09:54 +0000 |
commit | 02c5a32843007fc4e6d9ddeab26fcf669c375d8e (patch) | |
tree | ca342b6164da76ff1418e16b6492369a638f2342 | |
parent | 411793e1ba329a47eb692617ff37f9fcc22341f8 (diff) | |
download | scala-02c5a32843007fc4e6d9ddeab26fcf669c375d8e.tar.gz scala-02c5a32843007fc4e6d9ddeab26fcf669c375d8e.tar.bz2 scala-02c5a32843007fc4e6d9ddeab26fcf669c375d8e.zip |
Replaced some hard-coded paths
-rw-r--r-- | src/partest/scala/tools/partest/nest/CompileManager.scala | 7 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/nest/FileManager.scala | 47 |
2 files changed, 38 insertions, 16 deletions
diff --git a/src/partest/scala/tools/partest/nest/CompileManager.scala b/src/partest/scala/tools/partest/nest/CompileManager.scala index b96078aa26..526c59e1a4 100644 --- a/src/partest/scala/tools/partest/nest/CompileManager.scala +++ b/src/partest/scala/tools/partest/nest/CompileManager.scala @@ -78,12 +78,9 @@ class DirectCompiler extends SimpleCompiler { } class ReflectiveCompiler extends SimpleCompiler { - val nscDir = - new File("/home/phaller/svn/scala3/build/quick/lib/compiler/") - val parTestDir = - new File("/home/phaller/svn/scala3/build/quick/lib/partest/") + import FileManager.{latestCompFile, latestPartestFile} - val sepUrls = Array(nscDir.toURL, parTestDir.toURL) + val sepUrls = Array(latestCompFile.toURL, latestPartestFile.toURL) val sepLoader = new URLClassLoader(sepUrls) val sepCompilerClass = diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala index 19f29b3e73..60f01fe31f 100644 --- a/src/partest/scala/tools/partest/nest/FileManager.scala +++ b/src/partest/scala/tools/partest/nest/FileManager.scala @@ -67,22 +67,47 @@ elif [ -d "$PREFIX/bin" ]; then LATEST_CLDC="$PREFIX/lib/scalaapi10-unverified.jar"; LATEST_CLDCAPI="$PREFIX/lib/scalaapi10.jar"; */ - val LATEST_LIB = { + def findLatest() { + def prefixFile(relPath: String) = + new File(PREFIX, relPath) + NestUI.verbose("PREFIX: "+PREFIX) val dists = new File(PREFIX, "dists") val build = new File(PREFIX, "build") val bin = new File(PREFIX, "bin") - val latest_lib: File = - if (dists.exists && dists.isDirectory) - new File(PREFIX, "dists/latest/lib/scala-library.jar") - else if (build.exists && build.isDirectory) - new File(PREFIX, "build/quick/lib/library") - else if (bin.exists && bin.isDirectory) - new File(PREFIX, "lib/scala-library.jar") - else - error("Scala binaries could not be found") - latest_lib.getAbsolutePath + + if (dists.exists && dists.isDirectory) { + latestLibFile = prefixFile("dists/latest/lib/scala-library.jar") + latestCompFile = prefixFile("dists/latest/lib/scala-compiler.jar") + latestPartestFile = prefixFile("dists/latest/lib/scala-partest.jar") + } + else if (build.exists && build.isDirectory) { + latestLibFile = prefixFile("build/quick/lib/library") + latestCompFile = prefixFile("build/quick/lib/compiler") + latestPartestFile = prefixFile("build/quick/lib/partest") + } + else if (bin.exists && bin.isDirectory) { + latestLibFile = prefixFile("lib/scala-library.jar") + latestCompFile = prefixFile("lib/scala-compiler.jar") + latestPartestFile = prefixFile("lib/scala-partest.jar") + } + else + error("Scala binaries could not be found") + + LATEST_LIB = latestLibFile.getAbsolutePath + LATEST_COMP = latestCompFile.getAbsolutePath + LATEST_PARTEST = latestPartestFile.getAbsolutePath } + + var LATEST_LIB: String = "" + var LATEST_COMP: String = "" + var LATEST_PARTEST: String = "" + + var latestLibFile: File = _ + var latestCompFile: File = _ + var latestPartestFile: File = _ + // initialize above fields + findLatest() } class FileManager { |