|
12 | 12 | import java.util.Set;
|
13 | 13 |
|
14 | 14 | /**
|
15 |
| - * Define hooks that can be user-defined to modify the behaviour of |
| 15 | + * Defines hooks that can be user-defined to modify the behaviour of |
16 | 16 | * internal components of the incremental compiler.
|
17 | 17 | */
|
18 | 18 | public interface ExternalHooks {
|
19 | 19 | /**
|
20 |
| - * Define an interface for a lookup mechanism. |
| 20 | + * Defines an interface for a lookup mechanism. |
21 | 21 | */
|
22 |
| - public static interface Lookup { |
| 22 | + interface Lookup { |
23 | 23 |
|
24 | 24 | /**
|
25 | 25 | * Used to provide information from external tools into sbt (e.g. IDEs)
|
@@ -54,17 +54,36 @@ public static interface Lookup {
|
54 | 54 | }
|
55 | 55 |
|
56 | 56 | /**
|
57 |
| - * Return the implementation of a lookup mechanism to be used instead of |
| 57 | + * Returns the implementation of a lookup mechanism to be used instead of |
58 | 58 | * the internal lookup provided by the default implementation.
|
59 | 59 | */
|
60 |
| - Optional<Lookup> externalLookup(); |
| 60 | + Optional<Lookup> getExternalLookup(); |
61 | 61 |
|
62 | 62 | /**
|
63 |
| - * Return the implementation of a {@link ClassFileManager} to be used |
| 63 | + * Returns the implementation of a {@link ClassFileManager} to be used |
64 | 64 | * alongside the internal manager provided by the default implementation.
|
65 | 65 | * <p>
|
66 | 66 | * This class file manager is run after the internal
|
67 | 67 | * {@link ClassFileManager} defined in {@link IncOptions}.
|
68 | 68 | */
|
69 |
| - Optional<ClassFileManager> externalClassFileManager(); |
| 69 | + Optional<ClassFileManager> getExternalClassFileManager(); |
| 70 | + |
| 71 | + /** |
| 72 | + * Returns an instance of hooks that executes the external passed class file manager. |
| 73 | + * |
| 74 | + * If several class file manager are passed, they are aggregated and their execution happens |
| 75 | + * in the order of invocations of this method. |
| 76 | + * |
| 77 | + * @return An instance of {@link ExternalHooks} with the aggregated external class file manager. |
| 78 | + */ |
| 79 | + ExternalHooks withExternalClassFileManager(ClassFileManager externalClassFileManager); |
| 80 | + |
| 81 | + /** |
| 82 | + * Returns an instance of hooks with one lookup. |
| 83 | + * |
| 84 | + * If used several times, only the last lookup instance will be used. |
| 85 | + * |
| 86 | + * @return An instance of {@link ExternalHooks} with the specified lookup. |
| 87 | + */ |
| 88 | + ExternalHooks withExternalLookup(Lookup externalLookup); |
70 | 89 | }
|
0 commit comments