14
14
import java.io.File;
15
15
import java.util.List;
18
* Interface that handles where the compilation output is sent. Allows
19
* for the output folder to be different for different source files.
19
* Interface that handles where the compilation output is sent. Allows for the output folder to be different for different source
21
22
public interface IOutputLocationManager {
24
* Return the directory root under which the results of compiling the given
25
* source file. For example, if the source file contains the type a.b.C, and
26
* this method returns "target/classes" the resulting class file will be written
27
* to "target/classes/a/b/C.class"
25
* Return the directory root under which the results of compiling the given source file. For example, if the source file
26
* contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to
27
* "target/classes/a/b/C.class"
29
* @param compilationUnit the compilation unit that has been compiled
30
* @return a File object representing the root directory under which compilation results for this
31
* unit should be written
29
* @param compilationUnit the compilation unit that has been compiled
30
* @return a File object representing the root directory under which compilation results for this unit should be written
33
32
File getOutputLocationForClass(File compilationUnit);
36
* When copying resources from source folders to output location, return the
37
* root directory under which the resource should be copied.
35
* For environments where multiple source folders are supported, they need to be included in the model. This method allows
36
* AspectJ to determine which source folder a source file came from. Example return values would be "src" or "main/java"
38
* @param sourceFile the File object for the source file
39
* @return the source folder where this file came from, or null if in project root or source folders not supported.
41
String getSourceFolderForFile(File sourceFile);
44
* When copying resources from source folders to output location, return the root directory under which the resource should be
39
47
* @param resource the resource to be copied
40
* @return a File object representing the root directory under which this resource
48
* @return a File object representing the root directory under which this resource should be copied
43
50
File getOutputLocationForResource(File resource);
46
53
* Return a list of all output locations handled by this OutputLocationManager
48
List /*File*/ getAllOutputLocations();
55
List /* File */getAllOutputLocations();
51
* Return the default output location (for example, <my_project>/bin). This is
52
* where classes which are on the inpath will be placed.
58
* Return the default output location (for example, <my_project>/bin). This is where classes which are on the inpath will be
54
61
File getDefaultOutputLocation();
64
* Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also
67
* @param outputfile the file that has been written
68
* @param fileType the kind of file from the FILETYPE_XXX constants defined in this type
70
void reportFileWrite(String outputfile, int fileType);
73
* @return a Map<File,String> from inpath absolute paths to handle components
78
* Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also
81
* @param file the file that has been written
82
* @param fileType the kind of file from the FILETYPE_XXX constants defined in this type
84
void reportFileRemove(String file, int fileType);
86
int discoverChangesSince(File dir, long buildtime);
88
// match numbers in CompilationResultDestinationManager - ought to factor into super interface
89
int FILETYPE_UNKNOWN = 0;
90
int FILETYPE_CLASS = 1;
91
int FILETYPE_OUTJAR = 2;
92
int FILETYPE_RESOURCE = 3;