summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-06-24 13:01:12 +0000
committerPaul Phillips <paulp@improving.org>2009-06-24 13:01:12 +0000
commitec70057db55dd4f65a80e50fee085a5c62022a7a (patch)
tree43781c4a1ba3ad24bdb6f87b2b37c17b449e654f /src
parentd83917a2ee771186b151a151314dac092ae8530a (diff)
downloadscala-ec70057db55dd4f65a80e50fee085a5c62022a7a.tar.gz
scala-ec70057db55dd4f65a80e50fee085a5c62022a7a.tar.bz2
scala-ec70057db55dd4f65a80e50fee085a5c62022a7a.zip
Moving empty .scala_dependencies check around l...
Moving empty .scala_dependencies check around looking for the spot which won't cause trouble.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala9
-rw-r--r--src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala6
2 files changed, 9 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 9f6fe689cb..6db3bfd626 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -829,6 +829,13 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
dependencyAnalysis.saveDependencies()
}
+ // When all is said and done, if the dependencies file is 0 length
+ // delete it so people do not curse it with the vehemence with which
+ // they curse .DS_Store and the like.
+ def cleanupDependenciesFile() =
+ for (f <- dependencyAnalysis.dependenciesFile ; size <- f.sizeOption ; if size == 0)
+ f.delete
+
/** Compile list of abstract files */
def compileFiles(files: List[AbstractFile]) {
try {
@@ -836,6 +843,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
} catch {
case ex: IOException => error(ex.getMessage())
}
+ finally cleanupDependenciesFile
}
/** Compile list of files given by their names */
@@ -856,6 +864,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
} catch {
case ex: IOException => error(ex.getMessage())
}
+ finally cleanupDependenciesFile
}
/** Compile abstract file until `globalPhase`, but at least
diff --git a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala
index de141303fe..48b22677b2 100644
--- a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala
+++ b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala
@@ -94,12 +94,6 @@ trait DependencyAnalysis extends SubComponent with Files {
dependencies.depends(source, d.sourceFile);
}
}
- // When all is said and done, if the dependencies file is 0 length
- // delete it so people do not curse it with the vehemence with which
- // they curse .DS_Store and the like. This feels like a strange
- // place to put this, but was the best I could find on short notice.
- for (f <- dependenciesFile ; size <- f.sizeOption ; if size == 0)
- f.delete
}
}
}