summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-05-01 19:47:43 +0000
committerjhugunin <jhugunin>2003-05-01 19:47:43 +0000
commitaebd6651d39ba218431cd860d469ceb3d8063f9b (patch)
tree8fe910169b2c45c0cc8349c1d0d2a4e6fa782fec
parent7e47f0f2fa4e805f11a67f953aeeeb3e959fcc3d (diff)
downloadaspectj-aebd6651d39ba218431cd860d469ceb3d8063f9b.tar.gz
aspectj-aebd6651d39ba218431cd860d469ceb3d8063f9b.zip
more progress messages for ajde
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java2
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java23
2 files changed, 23 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index 791348519..f38f4451d 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -257,6 +257,7 @@ public class AjBuildManager {
public boolean weaveAndGenerateClassFiles() throws IOException {
handler.handleMessage(MessageUtil.info("weaving"));
if (progressListener != null) progressListener.setText("weaving aspects");
+ bcelWeaver.setProgressListener(progressListener, 0.5, 0.5/state.addedClassFiles.size());
//!!! doesn't provide intermediate progress during weaving
// XXX add all aspects even during incremental builds?
addAspectClassFilesToWeaver(state.addedClassFiles);
@@ -402,6 +403,7 @@ public class AjBuildManager {
if (progressListener != null) {
compiledCount++;
progressListener.setProgress((compiledCount/2.0)/sourceFileCount);
+ progressListener.setText("compiled: " + new String(compilationResult.getFileName()));
}
if (compilationResult.hasProblems() || compilationResult.hasTasks()) {
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
index 56756a074..445ee75ec 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -20,6 +20,7 @@ import java.util.zip.*;
import org.apache.bcel.classfile.ClassParser;
import org.apache.bcel.classfile.JavaClass;
import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.IProgressListener;
import org.aspectj.util.FileUtil;
import org.aspectj.weaver.*;
import org.aspectj.weaver.patterns.DeclareParents;
@@ -28,6 +29,9 @@ import org.aspectj.weaver.patterns.Pointcut;
public class BcelWeaver implements IWeaver {
private BcelWorld world;
private CrosscuttingMembersSet xcutSet;
+ private IProgressListener progressListener = null;
+ private double progressMade;
+ private double progressPerClassFile;
public BcelWeaver(BcelWorld world) {
super();
@@ -328,10 +332,18 @@ public class BcelWeaver implements IWeaver {
// non-private for testing
LazyClassGen weave(UnwovenClassFile classFile, BcelObjectType classType) throws IOException {
- return weave(classFile, classType, true);
+ LazyClassGen ret = weave(classFile, classType, true);
+
+ if (progressListener != null) {
+ progressMade += progressPerClassFile;
+ progressListener.setProgress(progressMade);
+ progressListener.setText("woven: " + classFile.getFilename());
+ }
+
+ return ret;
}
- private LazyClassGen weave(UnwovenClassFile classFile, BcelObjectType classType, boolean dump) throws IOException {
+ private LazyClassGen weave(UnwovenClassFile classFile, BcelObjectType classType, boolean dump) throws IOException {
if (classType.isSynthetic()) {
if (dump) dumpUnchanged(classFile);
return null;
@@ -430,4 +442,11 @@ public class BcelWeaver implements IWeaver {
}
return result;
}
+
+ public void setProgressListener(IProgressListener listener, double previousProgress, double progressPerClassFile) {
+ progressListener = listener;
+ this.progressMade = previousProgress;
+ this.progressPerClassFile = progressPerClassFile;
+ }
+
}