summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/interactive/BuildManager.scala4
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala12
-rw-r--r--src/compiler/scala/tools/nsc/interactive/SimpleBuildManager.scala5
3 files changed, 18 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
index 504e82dce3..1bb3217095 100644
--- a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
@@ -20,7 +20,7 @@ trait BuildManager {
/** The given files have been modified by the user. Recompile
* them and their dependent files.
*/
- def update(files: Set[AbstractFile])
+ def update(added: Set[AbstractFile], removed: Set[AbstractFile])
/** Load saved dependency information. */
def loadFrom(file: AbstractFile)
@@ -62,7 +62,7 @@ object BuildManagerTest extends EvalLoop {
loop { line =>
val args = List.fromString(line, ' ')
val command = new CompilerCommand(args, new Settings(error), error, true)
- buildManager.update(command.files)
+ buildManager.update(command.files, Set.empty)
}
}
diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
index 7120254c5d..8368990cde 100644
--- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
@@ -59,13 +59,23 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
/** Remove the given files from the managed build process. */
def removeFiles(files: Set[AbstractFile]) {
sources --= files
+ val changes = new mutable.HashMap[Symbol, List[Change]]
+ for (f <- files; sym <- definitions(f))
+ changes += sym -> List(Removed(Class(sym.fullNameString)))
+ update(invalidated(files, changes))
}
+ def update(added: Set[AbstractFile], removed: Set[AbstractFile]) {
+ removeFiles(removed)
+ update(added)
+ }
+
+
/** The given files have been modified by the user. Recompile
* them and all files that depend on them. Only files that
* have been previously added as source files are recompiled.
*/
- def update(files: Set[AbstractFile]): Unit = if (!files.isEmpty) {
+ private def update(files: Set[AbstractFile]): Unit = if (!files.isEmpty) {
val deps = compiler.dependencyAnalysis.dependencies
val run = compiler.newRun()
compiler.inform("compiling " + files)
diff --git a/src/compiler/scala/tools/nsc/interactive/SimpleBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/SimpleBuildManager.scala
index b5f0951656..b3ed0e0abf 100644
--- a/src/compiler/scala/tools/nsc/interactive/SimpleBuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/SimpleBuildManager.scala
@@ -40,6 +40,11 @@ class SimpleBuildManager(val settings: Settings) extends BuildManager {
sources --= files
}
+ def update(added: Set[AbstractFile], removed: Set[AbstractFile]) {
+ removeFiles(removed)
+ update(added)
+ }
+
/** The given files have been modified by the user. Recompile
* them and all files that depend on them. Only files that
* have been previously added as source files are recompiled.