Switching from log/learn to reportOutput/add

This commit is contained in:
Andrey Breslav
2012-11-12 19:57:39 +04:00
parent ef403cc91a
commit b2b5ccefbd
12 changed files with 128 additions and 130 deletions
@@ -61,7 +61,6 @@ public final class ClassFileFactory extends GenerationStateAware {
private ClassBuilder newVisitor(String outputFilePath, Collection<? extends PsiFile> sourceFiles) {
state.getProgress().reportOutput(toIoFilesIgnoringNonPhysical(sourceFiles), new File(outputFilePath));
state.getProgress().log("Emitting: " + outputFilePath);
final ClassBuilder answer = builderFactory.newClassBuilder();
generators.put(outputFilePath, answer);
return answer;
@@ -92,14 +92,6 @@ public class NamespaceCodegen extends MemberCodegen {
VirtualFile vFile = file.getVirtualFile();
try {
final String path = vFile != null ? vFile.getPath() : "no_virtual_file/" + file.getName();
if (progress != null) {
v.addOptionalDeclaration(new ClassBuilderOnDemand.ClassBuilderCallback() {
@Override
public void doSomething(@NotNull ClassBuilder classBuilder) {
progress.log("For source: " + path);
}
});
}
generate(file, multiFile);
}
catch (ProcessCanceledException e) {
@@ -27,18 +27,11 @@ import java.util.Collection;
public interface Progress {
Progress DEAF = new Progress() {
@Override
public void log(String message) {
}
@Override
public void reportOutput(@NotNull Collection<File> sourceFiles, @Nullable File outputFile) {
}
};
@Deprecated
void log(String message);
/**
* @param sourceFiles a (possibly empty) collection of source files {@code outputFile} was generated from
* @param outputFile an output file