use of org.jetbrains.jps.builders.storage.BuildDataCorruptedException in project intellij-community by JetBrains.
the class ResourcesBuilder method build.
@Override
public void build(@NotNull ResourcesTarget target, @NotNull DirtyFilesHolder<ResourceRootDescriptor, ResourcesTarget> holder, @NotNull final BuildOutputConsumer outputConsumer, @NotNull final CompileContext context) throws ProjectBuildException, IOException {
if (!isResourceProcessingEnabled(target.getModule())) {
return;
}
try {
holder.processDirtyFiles(new FileProcessor<ResourceRootDescriptor, ResourcesTarget>() {
private final Map<ResourceRootDescriptor, Boolean> mySkippedRoots = new HashMap<>();
public boolean apply(ResourcesTarget target, final File file, final ResourceRootDescriptor sourceRoot) throws IOException {
Boolean isSkipped = mySkippedRoots.get(sourceRoot);
if (isSkipped == null) {
final File outputDir = target.getOutputDir();
isSkipped = Boolean.valueOf(outputDir == null || FileUtil.filesEqual(outputDir, sourceRoot.getRootFile()));
mySkippedRoots.put(sourceRoot, isSkipped);
}
if (isSkipped.booleanValue()) {
return true;
}
try {
copyResource(context, sourceRoot, file, outputConsumer);
} catch (IOException e) {
LOG.info(e);
context.processMessage(new CompilerMessage("resources", BuildMessage.Kind.ERROR, e.getMessage(), FileUtil.toSystemIndependentName(file.getPath())));
return false;
}
return !context.getCancelStatus().isCanceled();
}
});
context.checkCanceled();
context.processMessage(new ProgressMessage(""));
} catch (BuildDataCorruptedException | ProjectBuildException e) {
throw e;
} catch (Exception e) {
throw new ProjectBuildException(e.getMessage(), e);
}
}
use of org.jetbrains.jps.builders.storage.BuildDataCorruptedException in project intellij-community by JetBrains.
the class IntObjectPersistentMultiMaplet method close.
@Override
public void close() {
try {
myCache.clear();
myMap.close();
} catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
use of org.jetbrains.jps.builders.storage.BuildDataCorruptedException in project intellij-community by JetBrains.
the class IntObjectPersistentMultiMaplet method remove.
@Override
public void remove(final int key) {
try {
myCache.remove(key);
myMap.remove(key);
} catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
use of org.jetbrains.jps.builders.storage.BuildDataCorruptedException in project intellij-community by JetBrains.
the class ObjectObjectPersistentMultiMaplet method close.
@Override
public void close() {
try {
myCache.clear();
myMap.close();
} catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
use of org.jetbrains.jps.builders.storage.BuildDataCorruptedException in project intellij-community by JetBrains.
the class ObjectObjectPersistentMultiMaplet method remove.
@Override
public void remove(final K key) {
try {
myCache.remove(key);
myMap.remove(key);
} catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
Aggregations