Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

IOutputLocationManager.java 3.5KB

15 år sedan
15 år sedan
15 år sedan
15 år sedan
15 år sedan
15 år sedan
15 år sedan
15 år sedan
15 år sedan
15 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /********************************************************************
  2. * Copyright (c) 2006 Contributors.All rights reserved.
  3. * This program and the accompanying materials are made available
  4. * under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution and is available at
  6. * http://eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Adrian Colyer Initial implementation
  10. * Helen Hawkins bug 166580 and 148190
  11. * ******************************************************************/
  12. package org.aspectj.ajde.core;
  13. import java.io.File;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * Interface that handles where the compilation output is sent. Allows for the output folder to be different for different source
  18. * files.
  19. */
  20. public interface IOutputLocationManager {
  21. /**
  22. * Return the directory root under which the results of compiling the given source file. For example, if the source file
  23. * contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to
  24. * "target/classes/a/b/C.class"
  25. *
  26. * @param compilationUnit the compilation unit that has been compiled
  27. * @return a File object representing the root directory under which compilation results for this unit should be written
  28. */
  29. File getOutputLocationForClass(File compilationUnit);
  30. /**
  31. * For environments where multiple source folders are supported, they need to be included in the model. This method allows
  32. * AspectJ to determine which source folder a source file came from. Example return values would be "src" or "main/java"
  33. *
  34. * @param sourceFile the File object for the source file
  35. * @return the source folder where this file came from, or null if in project root or source folders not supported.
  36. */
  37. String getSourceFolderForFile(File sourceFile);
  38. /**
  39. * When copying resources from source folders to output location, return the root directory under which the resource should be
  40. * copied.
  41. *
  42. * @param resource the resource to be copied
  43. * @return a File object representing the root directory under which this resource should be copied
  44. */
  45. File getOutputLocationForResource(File resource);
  46. /**
  47. * Return a list of all output locations handled by this OutputLocationManager
  48. */
  49. List<File> getAllOutputLocations();
  50. /**
  51. * Return the default output location (for example, &lt;my_project&gt;/bin). This is where classes which are on the inpath will be
  52. * placed.
  53. */
  54. File getDefaultOutputLocation();
  55. /**
  56. * Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also
  57. * supplied.
  58. *
  59. * @param outputfile the file that has been written
  60. * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type
  61. */
  62. void reportFileWrite(String outputfile, int fileType);
  63. /**
  64. * @return a Map&lt;File,String&gt; from inpath absolute paths to handle components
  65. */
  66. Map<File, String> getInpathMap();
  67. /**
  68. * Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also
  69. * supplied.
  70. *
  71. * @param file the file that has been written
  72. * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type
  73. */
  74. void reportFileRemove(String file, int fileType);
  75. int discoverChangesSince(File dir, long buildtime);
  76. // match numbers in CompilationResultDestinationManager - ought to factor into super interface
  77. int FILETYPE_UNKNOWN = 0;
  78. int FILETYPE_CLASS = 1;
  79. int FILETYPE_OUTJAR = 2;
  80. int FILETYPE_RESOURCE = 3;
  81. }