import org.aspectj.ajdt.internal.compiler.AjCompilerAdapter;
import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter;
+import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager;
import org.aspectj.ajdt.internal.compiler.IBinarySourceProvider;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapter;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapterFactory;
try {
if (zos != null) {
zos.close();
+ if (buildConfig.getCompilationResultDestinationManager() != null) {
+ buildConfig.getCompilationResultDestinationManager().reportFileWrite(outJar.getPath(),
+ CompilationResultDestinationManager.FILETYPE_OUTJAR);
+ }
}
zos = null;
/* Ensure we don't write an incomplete JAR bug-71339 */
if (handler.hasErrors()) {
outJar.delete();
+ if (buildConfig.getCompilationResultDestinationManager() != null) {
+ buildConfig.getCompilationResultDestinationManager().reportFileRemove(outJar.getPath(),
+ CompilationResultDestinationManager.FILETYPE_OUTJAR);
+ }
}
} catch (IOException ex) {
IMessage message = new Message("Unable to write outjar " + outJar.getPath() + "(" + ex.getMessage() + ")",
}
if (zos != null) {
ZipEntry newEntry = new ZipEntry(filename); // ??? get compression scheme right
-
zos.putNextEntry(newEntry);
zos.write(content);
zos.closeEntry();
destDir = buildConfig.getCompilationResultDestinationManager().getOutputLocationForResource(srcLocation);
}
try {
- OutputStream fos = FileUtil.makeOutputStream(new File(destDir, filename));
+ File outputLocation = new File(destDir, filename);
+ OutputStream fos = FileUtil.makeOutputStream(outputLocation);
fos.write(content);
fos.close();
+ if (buildConfig.getCompilationResultDestinationManager() != null) {
+ buildConfig.getCompilationResultDestinationManager().reportFileWrite(outputLocation.getPath(),
+ CompilationResultDestinationManager.FILETYPE_RESOURCE);
+ }
} catch (FileNotFoundException fnfe) {
IMessage msg = new Message("unable to copy resource to output folder: '" + filename + "' - reason: "
+ fnfe.getMessage(), IMessage.ERROR, null, new SourceLocation(srcLocation, 0));
// where we sent the classes that were on the inpath
outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
}
- if (outputDir == null)
+ if (outputDir == null) {
return;
- OutputStream fos = FileUtil.makeOutputStream(new File(outputDir, MANIFEST_NAME));
+ }
+ File outputLocation = new File(outputDir, MANIFEST_NAME);
+ OutputStream fos = FileUtil.makeOutputStream(outputLocation);
manifest.write(fos);
fos.close();
+ if (buildConfig.getCompilationResultDestinationManager() != null) {
+ buildConfig.getCompilationResultDestinationManager().reportFileWrite(outputLocation.getPath(),
+ CompilationResultDestinationManager.FILETYPE_RESOURCE);
+ }
}
}
os.write(classFile.getBytes());
os.close();
if (buildConfig.getCompilationResultDestinationManager() != null) {
- buildConfig.getCompilationResultDestinationManager().reportClassFileWrite(outFile);
+ buildConfig.getCompilationResultDestinationManager().reportFileWrite(outFile,
+ CompilationResultDestinationManager.FILETYPE_CLASS);
}
return outFile;
}
import java.util.Map;
import java.util.Set;
+import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager;
import org.aspectj.ajdt.internal.compiler.InterimCompilationResult;
import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
outputLoc = new File(outputLoc, (String) resourcePair.getKey());
if (!outputLoc.getPath().equals(sourcePath.getPath()) && outputLoc.exists()) {
outputLoc.delete();
+ if (buildConfig.getCompilationResultDestinationManager() != null) {
+ buildConfig.getCompilationResultDestinationManager().reportFileRemove(outputLoc.getPath(),
+ CompilationResultDestinationManager.FILETYPE_RESOURCE);
+ }
}
}
}
for (int i = 0; i < weaverGenerated.length; i++) {
weaverGenerated[i].delete();
if (buildConfig != null && buildConfig.getCompilationResultDestinationManager() != null) {
- buildConfig.getCompilationResultDestinationManager()
- .reportClassFileRemove(weaverGenerated[i].getPath());
+ buildConfig.getCompilationResultDestinationManager().reportFileRemove(weaverGenerated[i].getPath(),
+ CompilationResultDestinationManager.FILETYPE_CLASS);
}
}
}
}
locationOnDisk.delete();
if (buildConfig != null && buildConfig.getCompilationResultDestinationManager() != null) {
- buildConfig.getCompilationResultDestinationManager().reportClassFileRemove(locationOnDisk.getPath());
+ buildConfig.getCompilationResultDestinationManager().reportFileRemove(locationOnDisk.getPath(),
+ CompilationResultDestinationManager.FILETYPE_CLASS);
}
}
}