1 /* *******************************************************************
2 * Copyright (c) 2006 Contributors.
4 * This program and the accompanying materials are made available
5 * under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution and is available at
7 * http://eclipse.org/legal/epl-v10.html
10 * Adrian Colyer Initial implementation
11 * ******************************************************************/
12 package org.aspectj.ajdt.internal.compiler;
15 import java.util.List;
19 * acts as a bridge from ajde's OutputLocationManager interface to the compiler internals
24 public interface CompilationResultDestinationManager {
27 * Return the directory root under which the results of compiling the given source file. For example, if the source file
28 * contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to
29 * "target/classes/a/b/C.class"
31 * @param compilationUnit the compilation unit that has been compiled
32 * @return a File object representing the root directory under which compilation results for this unit should be written
34 File getOutputLocationForClass(File compilationUnit);
37 * Return the source folder where this source file came from, relative to the project root. For example 'src' or 'src/main/java'
40 * @param sourceFile the file for which the source folder should be determined
41 * @return the source folder
43 String getSourceFolderForFile(File sourceFile);
46 * When copying resources from source folders to output location, return the root directory under which the resource should be
49 * @param resource the resource to be copied
50 * @return a File object representing the root directory under which this resource should be copied
52 File getOutputLocationForResource(File resource);
55 * Return a list of all output locations handled by this OutputLocationManager
57 List /* File */getAllOutputLocations();
60 * Return the default output location (for example, <my_project>/bin). This is where classes which are on the inpath will be
63 File getDefaultOutputLocation();
66 * Report that a class file is being written to the specified location.
68 * @param outputfile the output file (including .class suffix)
70 void reportFileWrite(String outputfile, int filetype);
73 * Report that a class file is being deleted from the specified location.
75 * @param outputfile the output file (including .class suffix)
77 void reportFileRemove(String outputfile, int filetype);
81 int discoverChangesSince(File dir, long buildtime);
83 // match numbers in IOutputLocationManager - ought to factor into super interface
84 int FILETYPE_UNKNOWN = 0;
85 int FILETYPE_CLASS = 1;
86 int FILETYPE_OUTJAR = 2;
87 int FILETYPE_RESOURCE = 3;