fix message order in namespace codegen

This commit is contained in:
Stepan Koltsov
2012-06-08 17:57:03 +04:00
parent 671634c7c2
commit 2ac6a7c928
2 changed files with 11 additions and 4 deletions
@@ -77,7 +77,7 @@ public class NamespaceCodegen {
} }
public void generate(CompilationErrorHandler errorHandler, Progress progress) { public void generate(CompilationErrorHandler errorHandler, final Progress progress) {
ArrayList<Pair<JetFile, Collection<JetDeclaration>>> byFile = new ArrayList<Pair<JetFile, Collection<JetDeclaration>>>(); ArrayList<Pair<JetFile, Collection<JetDeclaration>>> byFile = new ArrayList<Pair<JetFile, Collection<JetDeclaration>>>();
for (JetFile file : files) { for (JetFile file : files) {
@@ -96,8 +96,15 @@ public class NamespaceCodegen {
for (JetFile file : files) { for (JetFile file : files) {
VirtualFile vFile = file.getVirtualFile(); VirtualFile vFile = file.getVirtualFile();
try { try {
String path = vFile != null ? vFile.getPath() : "no_virtual_file/" + file.getName(); final String path = vFile != null ? vFile.getPath() : "no_virtual_file/" + file.getName();
if(progress != null) progress.log("For source: " + path); if (progress != null) {
v.addOptionalDeclaration(new ClassBuilderOnDemand.ClassBuilderCallback() {
@Override
public void doSomething(@NotNull ClassBuilder classBuilder) {
progress.log("For source: " + path);
}
});
}
generate(file, multiFile); generate(file, multiFile);
} }
catch (ProcessCanceledException e) { catch (ProcessCanceledException e) {
@@ -2,8 +2,8 @@ OUT Buildfile: build.xml
OUT OUT
OUT build: OUT build:
OUT [kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar] OUT [kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
OUT [kotlinc] LOGGING: For source: [TestData]/hello.kt
OUT [kotlinc] LOGGING: Emitting: Hello/namespace.class OUT [kotlinc] LOGGING: Emitting: Hello/namespace.class
OUT [kotlinc] LOGGING: For source: [TestData]/hello.kt
OUT OUT
OUT BUILD SUCCESSFUL OUT BUILD SUCCESSFUL
OUT Total time: [time] OUT Total time: [time]