mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
clean source-to-outputs cache on chunk successfull compilation
This commit is contained in:
@@ -258,6 +258,18 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clean mapping only after everything else is processed
|
||||
final Map<String, Collection<String>> map = Utils.CHUNK_PER_MODULE_REMOVED_SOURCES_KEY.get(this);
|
||||
if (map != null) {
|
||||
for (Map.Entry<String, Collection<String>> entry : map.entrySet()) {
|
||||
final SourceToOutputMapping mapping = getDataManager().getSourceToOutputMap(entry.getKey(), isCompilingTests());
|
||||
for (String path : entry.getValue()) {
|
||||
mapping.remove(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (marked) {
|
||||
processMessage(UptoDateFilesSavedEvent.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -429,6 +429,7 @@ public class IncProjectBuilder {
|
||||
}
|
||||
finally {
|
||||
Utils.CHUNK_REMOVED_SOURCES_KEY.set(context, null);
|
||||
Utils.CHUNK_PER_MODULE_REMOVED_SOURCES_KEY.set(context, null);
|
||||
if (doneSomething && GENERATE_CLASSPATH_INDEX) {
|
||||
final boolean forTests = context.isCompilingTests();
|
||||
final Future<?> future = SharedThreadPool.INSTANCE.submit(new Runnable() {
|
||||
@@ -485,6 +486,7 @@ public class IncProjectBuilder {
|
||||
try {
|
||||
// cleanup outputs
|
||||
final Set<String> allChunkRemovedSources = new HashSet<String>();
|
||||
final Map<String, Collection<String>> perModuleRemovedSources = new HashMap<String, Collection<String>>();
|
||||
|
||||
for (Module module : chunk.getModules()) {
|
||||
final Collection<String> deletedPaths = myProjectDescriptor.fsState.getDeletedPaths(module.getName(), context.isCompilingTests());
|
||||
@@ -492,6 +494,7 @@ public class IncProjectBuilder {
|
||||
continue;
|
||||
}
|
||||
allChunkRemovedSources.addAll(deletedPaths);
|
||||
perModuleRemovedSources.put(module.getName(), deletedPaths);
|
||||
|
||||
final SourceToOutputMapping sourceToOutputStorage =
|
||||
context.getDataManager().getSourceToOutputMap(module.getName(), context.isCompilingTests());
|
||||
@@ -521,8 +524,8 @@ public class IncProjectBuilder {
|
||||
for (String output : outputs) {
|
||||
new File(output).delete();
|
||||
}
|
||||
sourceToOutputStorage.remove(deletedSource);
|
||||
}
|
||||
//sourceToOutputStorage.remove(deletedSource);
|
||||
|
||||
// check if deleted source was associated with a form
|
||||
final SourceToFormMapping sourceToFormMap = context.getDataManager().getSourceToFormMap();
|
||||
@@ -542,6 +545,7 @@ public class IncProjectBuilder {
|
||||
allChunkRemovedSources.addAll(currentData);
|
||||
}
|
||||
Utils.CHUNK_REMOVED_SOURCES_KEY.set(context, allChunkRemovedSources);
|
||||
Utils.CHUNK_PER_MODULE_REMOVED_SOURCES_KEY.set(context, perModuleRemovedSources);
|
||||
for (Module module : chunk.getModules()) {
|
||||
myProjectDescriptor.fsState.clearDeletedPaths(module.getName(), context.isCompilingTests());
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@ import org.jetbrains.jps.Project;
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
@@ -18,6 +16,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class Utils {
|
||||
public static final Key<Set<String>> CHUNK_REMOVED_SOURCES_KEY = Key.create("_chunk_removed_sources_");
|
||||
public static final Key<Map<String, Collection<String>>> CHUNK_PER_MODULE_REMOVED_SOURCES_KEY = Key.create("_chunk_per_maodule_removed_sources_");
|
||||
private static volatile File ourSystemRoot = new File(System.getProperty("user.home", ".jps-server"));
|
||||
|
||||
private Utils() {
|
||||
|
||||
Reference in New Issue
Block a user