Skip to content

Commit

Permalink
Merge pull request #1293 from Friendseeker/stale-class-file
Browse files Browse the repository at this point in the history
Delete products of previous analysis when dropping previous analysis
  • Loading branch information
eed3si9n committed Dec 2, 2023
2 parents 82c51e9 + 20aff0e commit 99484c3
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,14 @@ class IncrementalCompilerImpl extends IncrementalCompiler {
previousSetup match {
// The dummy output needs to be changed to .jar for this to work again.
// case _ if compileToJarSwitchedOn(mixedCompiler.config) => Analysis.empty
case Some(prev) if equiv.equiv(prev, currentSetup) => previousAnalysis
case Some(prev) if !equivPairs.equiv(prev.extra, currentSetup.extra) => Analysis.empty
case Some(prev) if equiv.equiv(prev, currentSetup) => previousAnalysis
case Some(prev) if !equivPairs.equiv(prev.extra, currentSetup.extra) =>
import sbt.internal.inc.ClassFileManager
val classFileManager =
ClassFileManager.getClassFileManager(incOptions, output, outputJarContent)
val products = previousAnalysis.asInstanceOf[Analysis].relations.allProducts
classFileManager.delete(products.map(converter.toVirtualFile).toArray)
Analysis.empty
case _ =>
val srcs = config.sources.toSet
Incremental.prune(srcs, previousAnalysis, output, outputJarContent, converter, incOptions)
Expand Down

0 comments on commit 99484c3

Please sign in to comment.