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;
18 * acts as a bridge from ajde's OutputLocationManager interface to the compiler internals
23 public interface CompilationResultDestinationManager {
26 * Return the directory root under which the results of compiling the given source file. For example, if the source file
27 * contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to
28 * "target/classes/a/b/C.class"
30 * @param compilationUnit the compilation unit that has been compiled
31 * @return a File object representing the root directory under which compilation results for this unit should be written
33 File getOutputLocationForClass(File compilationUnit);
36 * Return the source folder where this source file came from, relative to the project root. For example 'src' or 'src/main/java'
39 * @param sourceFile the file for which the source folder should be determined
40 * @return the source folder
42 String getSourceFolderForFile(File sourceFile);
45 * When copying resources from source folders to output location, return the root directory under which the resource should be
48 * @param resource the resource to be copied
49 * @return a File object representing the root directory under which this resource should be copied
51 File getOutputLocationForResource(File resource);
54 * Return a list of all output locations handled by this OutputLocationManager
56 List /* File */getAllOutputLocations();
59 * Return the default output location (for example, <my_project>/bin). This is where classes which are on the inpath will be
62 File getDefaultOutputLocation();
65 * Report that a class file is being written to the specified location.
67 * @param outputfile the output file (including .class suffix)
69 void reportFileWrite(String outputfile, int filetype);
72 * Report that a class file is being deleted from the specified location.
74 * @param outputfile the output file (including .class suffix)
76 void reportFileRemove(String outputfile, int filetype);
78 int discoverChangesSince(File dir, long buildtime);
80 // match numbers in IOutputLocationManager - ought to factor into super interface
81 int FILETYPE_UNKNOWN = 0;
82 int FILETYPE_CLASS = 1;
83 int FILETYPE_OUTJAR = 2;
84 int FILETYPE_RESOURCE = 3;