From 48d455142d22b73b8f5bf7c3e994736cc762a30f Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 16 Sep 2008 23:24:22 +0000 Subject: [PATCH] supporting multiple source folders in the model - to ensure handles compatible with JDT --- .../org/aspectj/ajde/core/IOutputLocationManager.java | 11 +++++++++++ .../ajde/core/internal/OutputLocationAdapter.java | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java b/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java index 7025f44b0..ab76f28fd 100644 --- a/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java +++ b/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java @@ -31,6 +31,16 @@ public interface IOutputLocationManager { * unit should be written */ File getOutputLocationForClass(File compilationUnit); + + /** + * For environments where multiple source folders are supported, they need to be included + * in the model. This method allows AspectJ to determine which source folder a source file + * came from. Example return values would be "src" or "main/java" + * + * @param sourceFile the File object for the source file + * @return the source folder where this file came from, or null if in project root or source folders not supported. + */ + String getSourceFolderForFile(File sourceFile); /** * When copying resources from source folders to output location, return the @@ -52,5 +62,6 @@ public interface IOutputLocationManager { * where classes which are on the inpath will be placed. */ File getDefaultOutputLocation(); + } 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 95c12daee..decf080d9 100644 --- a/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java +++ b/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java @@ -33,6 +33,10 @@ public class OutputLocationAdapter implements CompilationResultDestinationManage public File getOutputLocationForClass(File compilationUnit) { return this.locationManager.getOutputLocationForClass(compilationUnit); } + + public String getSourceFolderForFile(File sourceFile) { + return this.locationManager.getSourceFolderForFile(sourceFile); + } public File getOutputLocationForResource(File resource) { return this.locationManager.getOutputLocationForResource(resource); -- 2.39.5