Search in sources :

Example 1 with FilesDelta

use of org.jetbrains.jps.incremental.fs.FilesDelta in project intellij-community by JetBrains.

the class IncProjectBuilder method checkUpToDate.

public void checkUpToDate(CompileScope scope) {
    CompileContextImpl context = null;
    try {
        context = createContext(scope);
        final BuildFSState fsState = myProjectDescriptor.fsState;
        for (BuildTarget<?> target : myProjectDescriptor.getBuildTargetIndex().getAllTargets()) {
            if (scope.isAffected(target)) {
                BuildOperations.ensureFSStateInitialized(context, target);
                final FilesDelta delta = fsState.getEffectiveFilesDelta(context, target);
                delta.lockData();
                try {
                    for (Set<File> files : delta.getSourcesToRecompile().values()) {
                        for (File file : files) {
                            if (scope.isAffected(target, file)) {
                                // this will serve as a marker that compiler has work to do
                                myMessageDispatcher.processMessage(DoneSomethingNotification.INSTANCE);
                                return;
                            }
                        }
                    }
                } finally {
                    delta.unlockData();
                }
            }
        }
    } catch (Exception e) {
        LOG.info(e);
        // this will serve as a marker that compiler has work to do
        myMessageDispatcher.processMessage(DoneSomethingNotification.INSTANCE);
    } finally {
        if (context != null) {
            flushContext(context);
        }
    }
}
Also used : BuildFSState(org.jetbrains.jps.incremental.fs.BuildFSState) FilesDelta(org.jetbrains.jps.incremental.fs.FilesDelta) File(java.io.File) InvocationTargetException(java.lang.reflect.InvocationTargetException) BuildDataCorruptedException(org.jetbrains.jps.builders.storage.BuildDataCorruptedException) IOException(java.io.IOException) MappingFailedException(com.intellij.util.io.MappingFailedException)

Aggregations

MappingFailedException (com.intellij.util.io.MappingFailedException)1 File (java.io.File)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 BuildDataCorruptedException (org.jetbrains.jps.builders.storage.BuildDataCorruptedException)1 BuildFSState (org.jetbrains.jps.incremental.fs.BuildFSState)1 FilesDelta (org.jetbrains.jps.incremental.fs.FilesDelta)1