Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete products of previous analysis when dropping previous analysis #1293

Merged
merged 2 commits into from
Dec 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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