From 838a7aa6a6551528230b8e6d5d07e9f3bf4c8a94 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 23 Mar 2009 02:28:47 +0000 Subject: [PATCH] generalize report API to cover resources and outjar --- .../ajde/core/IOutputLocationManager.java | 23 +++++++++++++++++-- .../core/internal/OutputLocationAdapter.java | 9 ++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java b/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java index c1b4cad0e..dc8f24b1f 100644 --- a/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java +++ b/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java @@ -59,8 +59,27 @@ public interface IOutputLocationManager { */ File getDefaultOutputLocation(); - void reportClassFileWrite(String outputfile); + /** + * Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also + * supplied. + * + * @param outputfile the file that has been written + * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type + */ + void reportFileWrite(String outputfile, int fileType); - void reportClassFileRemove(String outputfile); + /** + * Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also + * supplied. + * + * @param file the file that has been written + * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type + */ + void reportFileRemove(String file, int fileType); + // match numbers in CompilationResultDestinationManager - ought to factor into super interface + int FILETYPE_UNKNOWN = 0; + int FILETYPE_CLASS = 1; + int FILETYPE_OUTJAR = 2; + int FILETYPE_RESOURCE = 3; } diff --git a/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java b/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java index 3fdb7e16c..65a8aaafd 100644 --- a/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java +++ b/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java @@ -49,11 +49,12 @@ public class OutputLocationAdapter implements CompilationResultDestinationManage return this.locationManager.getDefaultOutputLocation(); } - public void reportClassFileWrite(String outputfile) { - this.locationManager.reportClassFileWrite(outputfile); + public void reportFileWrite(String outputfile, int filetype) { + this.locationManager.reportFileWrite(outputfile, filetype); } - public void reportClassFileRemove(String outputfile) { - this.locationManager.reportClassFileRemove(outputfile); + public void reportFileRemove(String outputfile, int filetype) { + this.locationManager.reportFileRemove(outputfile, filetype); } + } -- 2.39.5