summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2009-08-02 18:01:22 +0000
committerMiles Sabin <miles@milessabin.com>2009-08-02 18:01:22 +0000
commitd339959ff129d9c3ccabad25d924618d21b7a471 (patch)
treeea1ca1aa197c9152da29ede1dd528735e8c2e20b /src/compiler/scala/tools/nsc/Global.scala
parent11ee847d384dcd0f45295380809f66961ebe25a3 (diff)
downloadscala-d339959ff129d9c3ccabad25d924618d21b7a471.tar.gz
scala-d339959ff129d9c3ccabad25d924618d21b7a471.tar.bz2
scala-d339959ff129d9c3ccabad25d924618d21b7a471.zip
More work on build manager.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 20053d112b..9ceb470565 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -221,7 +221,27 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
case x =>
val jfile = new java.io.File(x)
if (!jfile.exists) jfile.createNewFile
- else dependencyAnalysis.loadFrom(AbstractFile.getFile(jfile))
+ else {
+ // This logic moved here from scala.tools.nsc.dependencies.File.
+ // Note that it will trip an assertion in lookupPathUnchecked
+ // if the path being looked at is absolute.
+
+ /** The directory where file lookup should start at. */
+ val rootDirectory: AbstractFile = {
+ AbstractFile.getDirectory(".")
+// val roots = java.io.File.listRoots()
+// assert(roots.length > 0)
+// new PlainFile(roots(0))
+ }
+
+ def toFile(path: String) = {
+ val file = rootDirectory.lookupPathUnchecked(path, false)
+ assert(file ne null, path)
+ file
+ }
+
+ dependencyAnalysis.loadFrom(AbstractFile.getFile(jfile), toFile)
+ }
}
lazy val classPath0 = new ClassPath(false && onlyPresentation)
@@ -830,8 +850,17 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
for ((sym, file) <- symSource.iterator) resetPackageClass(sym.owner)
informTime("total", startTime)
- if (!dependencyAnalysis.off)
- dependencyAnalysis.saveDependencies()
+ if (!dependencyAnalysis.off) {
+
+ def fromFile(file: AbstractFile): String = {
+ val path = file.path
+ if (path.startsWith("./"))
+ path.substring(2, path.length)
+ else path
+ }
+
+ dependencyAnalysis.saveDependencies(fromFile)
+ }
}
/** Compile list of abstract files */