From: jhugunin Date: Thu, 1 May 2003 19:47:43 +0000 (+0000) Subject: more progress messages for ajde X-Git-Tag: V1_1_0_RC2~94 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aebd6651d39ba218431cd860d469ceb3d8063f9b;p=aspectj.git more progress messages for ajde --- 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; + } + }