if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
SubMonitor subMonitor = SubMonitor.convert(monitor, deltas.size() * 2 + 2);
IProject project = context.getBuiltProject();
CompilerPreferences compilerPreferences = compilerPreferences(storeAccess, project);
if (!compilerPreferences.shouldCompileProtoFiles()) {
return;
}
PathsPreferences pathsPreferences = new PathsPreferences(storeAccess, project);
ProtocCommandBuilder commandBuilder = new ProtocCommandBuilder(compilerPreferences, pathsPreferences);
for (Delta delta : deltas) {
if (subMonitor.isCanceled()) {
throw new OperationCanceledException();
}
IFile protoFile = protoFile(delta.getUri(), project);
subMonitor.worked(1);
if (protoFile != null) {
subMonitor.subTask("Compiling " + protoFile.getName() + " with protoc");
generateSingleProto(commandBuilder.buildCommand(protoFile), protoFile);
}
subMonitor.worked(1);
}
if (compilerPreferences.refreshResources()) {
List<IFolder> outputDirectories = commandBuilder.outputDirectories();
boolean refreshProject = compilerPreferences.refreshProject();
refresh(project, outputDirectories, refreshProject, subMonitor.newChild(outputDirectories.size() + 1));
}
}