aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorSteve Jenson <stevej@twitter.com>2010-10-14 13:49:20 -0700
committerChristopher Vogt <oss.nsp@cvogt.org>2016-11-07 02:08:36 -0500
commit42d267437746ebcb81145a3010484d0c32bc4266 (patch)
tree1c8c547e5b6036acde625712a31eb02907b1f804 /libraries
parent1b71e264839b0467fd5d000016727f7214639b76 (diff)
downloadcbt-42d267437746ebcb81145a3010484d0c32bc4266.tar.gz
cbt-42d267437746ebcb81145a3010484d0c32bc4266.tar.bz2
cbt-42d267437746ebcb81145a3010484d0c32bc4266.zip
adds an absolute path to the beginning of each referenced jar for building a classpath to hand to the compiler.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/eval/Eval.scala11
1 files changed, 8 insertions, 3 deletions
diff --git a/libraries/eval/Eval.scala b/libraries/eval/Eval.scala
index 8a2db1c..e606b7c 100644
--- a/libraries/eval/Eval.scala
+++ b/libraries/eval/Eval.scala
@@ -125,17 +125,22 @@ object Eval {
val classPathAndClassPathsNestedInJars = configulousClasspath.flatMap { fileName =>
val nestedClassPath = if (JarFile.findFirstMatchIn(fileName).isDefined) {
val nestedClassPathAttribute = new JarFile(fileName).getManifest.getMainAttributes.getValue("Class-Path")
+ // turns /usr/foo/bar/foo-1.0.jar into ["", "usr", "foo", "bar", "foo-1.0.jar"]
+ val rootDirPath = fileName.split(File.separator).toList
+ // and then into /usr/foo/bar
+ val rootDir = rootDirPath.slice(1, rootDirPath.length - 1).mkString(File.separator, File.separator, File.separator)
+
if (nestedClassPathAttribute != null) {
- nestedClassPathAttribute.split(" ").toList
+ nestedClassPathAttribute.split(" ").toList.map(rootDir + File.separator + _)
} else Nil
} else Nil
List(fileName) ::: nestedClassPath
}
- val bootClassPath = origBootclasspath.split(java.io.File.pathSeparator).toList
+ val bootClassPath = origBootclasspath.split(File.pathSeparator).toList
// the classpath for compile is our app path + boot path + make sure we have compiler/lib there
val pathList = bootClassPath ::: (classPathAndClassPathsNestedInJars ::: List(compilerPath, libPath))
- val pathString = pathList.mkString(java.io.File.pathSeparator)
+ val pathString = pathList.mkString(File.pathSeparator)
settings.bootclasspath.value = pathString
settings.classpath.value = pathString
settings.deprecation.value = true // enable detailed deprecation warnings