invalidate sources that claim to generate the same class. fixes #260

This commit is contained in:
Mark Harrah 2011-11-10 21:30:30 -05:00
parent ed22ac31a3
commit a49c907146
5 changed files with 19 additions and 1 deletions

View File

@ -87,10 +87,19 @@ object Incremental
def invalidateIncremental(previous: Relations, changes: APIChanges[File], recompiledSources: Set[File], log: Logger): Set[File] =
{
val inv = invalidateTransitive(previous.usesInternalSrc _, changes.modified, log)// ++ scopeInvalidations(previous.extAPI _, changes.modified, changes.names)
val inv =
invalidateTransitive(previous.usesInternalSrc _, changes.modified, log) ++
invalidateDuplicates(previous)
// ++ scopeInvalidations(previous.extAPI _, changes.modified, changes.names)
if((inv -- recompiledSources).isEmpty) Set.empty else inv
}
/** Invalidate all sources that claim to produce the same class file as another source file. */
def invalidateDuplicates(merged: Relations): Set[File] =
merged.srcProd.reverseMap.flatMap { case (classFile, sources) =>
if(sources.size > 1) sources else Nil
} toSet;
/** Only invalidates direct source dependencies. It excludes any sources that were recompiled during the previous run.
* Callers may want to augment the returned set with 'modified' or all sources recompiled up to this point. */
def invalidateDirect(dependsOnSrc: File => Set[File], modified: Set[File]): Set[File] =

View File

@ -0,0 +1 @@
object A

View File

@ -0,0 +1 @@
object A

View File

@ -0,0 +1 @@
object B

View File

@ -0,0 +1,6 @@
$ copy-file changes/A.scala A.scala
> compile
$ copy-file changes/A2.scala B.scala
-> compile
$ copy-file changes/B.scala B.scala
> compile