You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CompilationResultDestinationManager.java 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* *******************************************************************
  2. * Copyright (c) 2006 Contributors.
  3. * All rights reserved.
  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
  8. *
  9. * Contributors:
  10. * Adrian Colyer Initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler;
  13. import java.io.File;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * acts as a bridge from ajde's OutputLocationManager interface to the compiler internals
  18. *
  19. * @author adrian
  20. *
  21. */
  22. public interface CompilationResultDestinationManager {
  23. /**
  24. * Return the directory root under which the results of compiling the given source file. For example, if the source file
  25. * contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to
  26. * "target/classes/a/b/C.class"
  27. *
  28. * @param compilationUnit the compilation unit that has been compiled
  29. * @return a File object representing the root directory under which compilation results for this unit should be written
  30. */
  31. File getOutputLocationForClass(File compilationUnit);
  32. /**
  33. * Return the source folder where this source file came from, relative to the project root. For example 'src' or 'src/main/java'
  34. * or 'src/test/java'
  35. *
  36. * @param sourceFile the file for which the source folder should be determined
  37. * @return the source folder
  38. */
  39. String getSourceFolderForFile(File sourceFile);
  40. /**
  41. * When copying resources from source folders to output location, return the root directory under which the resource should be
  42. * copied.
  43. *
  44. * @param resource the resource to be copied
  45. * @return a File object representing the root directory under which this resource should be copied
  46. */
  47. File getOutputLocationForResource(File resource);
  48. /**
  49. * Return a list of all output locations handled by this OutputLocationManager
  50. */
  51. List /* File */getAllOutputLocations();
  52. /**
  53. * Return the default output location (for example, <my_project>/bin). This is where classes which are on the inpath will be
  54. * placed.
  55. */
  56. File getDefaultOutputLocation();
  57. /**
  58. * Report that a class file is being written to the specified location.
  59. *
  60. * @param outputfile the output file (including .class suffix)
  61. */
  62. void reportFileWrite(String outputfile, int filetype);
  63. /**
  64. * Report that a class file is being deleted from the specified location.
  65. *
  66. * @param outputfile the output file (including .class suffix)
  67. */
  68. void reportFileRemove(String outputfile, int filetype);
  69. Map getInpathMap();
  70. int discoverChangesSince(File dir, long buildtime);
  71. // match numbers in IOutputLocationManager - ought to factor into super interface
  72. int FILETYPE_UNKNOWN = 0;
  73. int FILETYPE_CLASS = 1;
  74. int FILETYPE_OUTJAR = 2;
  75. int FILETYPE_RESOURCE = 3;
  76. }