diff options
author | Liam Miller-Cushon <cushon@google.com> | 2016-06-29 03:33:17 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2016-06-29 08:57:04 +0000 |
commit | d565be110c283219f96f0c4f96fe232cb9f5b232 (patch) | |
tree | 02fd130de0b17f748ef997f6002832b0916e6777 /src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java | |
parent | 772b5bbaf719a28a65a9f5a624d5212e3bdcb091 (diff) |
Add java_plugin.generates_api
This attribute marks annotation processors that generate API code.
If a rule uses an API-generating annotation processor, other rules depending on
it can refer to the generated code only if their compilation actions are
scheduled after the generating rule.
In the future, annotation processors will only be considered by header
compilation if they set generates_api=1.
--
MOS_MIGRATED_REVID=126152384
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java index 27f7d52443..ab9cde87d3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java @@ -131,6 +131,7 @@ public final class JavaConfiguration extends Fragment { private final Label javaLauncherLabel; private final boolean useIjars; private final boolean useHeaderCompilation; + private final boolean optimizeHeaderCompilationAnnotationProcessing; private final boolean generateJavaDeps; private final JavaClasspathMode experimentalJavaClasspath; private final ImmutableList<String> javaWarns; @@ -157,6 +158,8 @@ public final class JavaConfiguration extends Fragment { this.javaLauncherLabel = javaOptions.javaLauncher; this.useIjars = javaOptions.useIjars; this.useHeaderCompilation = javaOptions.headerCompilation; + this.optimizeHeaderCompilationAnnotationProcessing = + javaOptions.optimizeHeaderCompilationAnnotationProcessing; this.generateJavaDeps = generateJavaDeps; this.experimentalJavaClasspath = javaOptions.experimentalJavaClasspath; this.javaWarns = ImmutableList.copyOf(javaOptions.javaWarns); @@ -219,6 +222,11 @@ public final class JavaConfiguration extends Fragment { return useHeaderCompilation; } + /** Returns true if only api-generating java_plugins should be run during header compilation. */ + public boolean optimizeHeaderCompilationAnnotationProcessing() { + return optimizeHeaderCompilationAnnotationProcessing; + } + /** * Returns true iff dependency information is generated after compilation. */ |