import java.util.Map;
import org.aspectj.bridge.IProgressListener;
+import org.aspectj.bridge.MessageUtil;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.aspectj.weaver.IClassFileProvider;
import org.aspectj.weaver.IWeaveRequestor;
*/
public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Iterator {
- private AjCompilerAdapter compilerAdapter;
+ private AbstractCompilerAdapter compilerAdapter;
private Iterator resultIterator;
private int classFileIndex = 0;
private InterimCompilationResult nowProcessing;
private int progressCompletionCount;
- public WeaverAdapter(AjCompilerAdapter forCompiler,
+ public WeaverAdapter(AbstractCompilerAdapter forCompiler,
WeaverMessageHandler weaverMessageHandler,
IProgressListener progressListener) {
this.compilerAdapter = forCompiler;
localIteratorCounter = 0;
nowProcessing = null;
lastReturnedResult = null;
- resultIterator = compilerAdapter.resultsPendingWeave.iterator();
+ resultIterator = compilerAdapter.getResultsPendingWeave().iterator();
return this;
}
/* (non-Javadoc)
AjClassFile ajcf = new AjClassFile(className.toCharArray(),
result.getBytes());
lastReturnedResult.result().record(ajcf.fileName(),ajcf);
-
+ //System.err.println(progressPhasePrefix+result.getClassName()+" (from "+nowProcessing.fileName()+")");
+ weaverMessageHandler.handleMessage(MessageUtil.info(progressPhasePrefix+result.getClassName()+" (from "+nowProcessing.fileName()+")"));
if (progressListener != null) {
progressCompletionCount++;
import java.util.zip.ZipEntry;
import org.aspectj.ajdt.internal.compiler.AjCompilerAdapter;
+import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter;
import org.aspectj.ajdt.internal.compiler.IBinarySourceProvider;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapter;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapterFactory;
}
}
+ unitResult.compiledTypes.clear(); // free up references to AjClassFile instances
}
if (unitResult.hasProblems() || unitResult.hasTasks()) {
new Parser(
pr,
forCompiler.options.parseLiteralExpressionsAsConstants);
-
- return new AjCompilerAdapter(forCompiler,batchCompile,getBcelWorld(),getWeaver(),
- factory,
- getInterimResultRequestor(),
- progressListener,
- this, // IOutputFilenameProvider
- this, // IBinarySourceProvider
- state.getBinarySourceMap(),
- buildConfig.isTerminateAfterCompilation(),
- buildConfig.getProceedOnError(),
- buildConfig.isNoAtAspectJAnnotationProcessing(),
- state);
+ if (getBcelWorld().shouldPipelineCompilation()) {
+ IMessage message = MessageUtil.info("Pipelining compilation");
+ handler.handleMessage(message);
+ return new AjPipeliningCompilerAdapter(forCompiler,batchCompile,getBcelWorld(),getWeaver(),
+ factory,
+ getInterimResultRequestor(),
+ progressListener,
+ this, // IOutputFilenameProvider
+ this, // IBinarySourceProvider
+ state.getBinarySourceMap(),
+ buildConfig.isTerminateAfterCompilation(),
+ buildConfig.getProceedOnError(),
+ buildConfig.isNoAtAspectJAnnotationProcessing(),
+ state);
+ } else {
+ return new AjCompilerAdapter(forCompiler,batchCompile,getBcelWorld(),getWeaver(),
+ factory,
+ getInterimResultRequestor(),
+ progressListener,
+ this, // IOutputFilenameProvider
+ this, // IBinarySourceProvider
+ state.getBinarySourceMap(),
+ buildConfig.isTerminateAfterCompilation(),
+ buildConfig.getProceedOnError(),
+ buildConfig.isNoAtAspectJAnnotationProcessing(),
+ state);
+ }
}
/**