Skip to content

Commit

Permalink
Remove internal experimental_disable_annotation_processing API
Browse files Browse the repository at this point in the history
Now that `java_common.compile(enable_annotation_processing)` is available

PiperOrigin-RevId: 386998998
  • Loading branch information
cushon authored and Copybara-Service committed Jul 27, 2021
1 parent 4b3c740 commit d4dd203
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,17 +591,6 @@ public Builder setJavaConstraints(ImmutableList<String> javaConstraints) {
return this;
}

// TODO(b/111090089): delete once java_common.compile(enable_annotation_processing) is
// available
public Builder experimentalDisableAnnotationProcessing() {
JavaPluginInfo provider =
(JavaPluginInfo) providerMap.getProvider(JavaPluginInfo.PROVIDER.getKey());
if (provider != null) {
providerMap.put(provider.disableAnnotationProcessing());
}
return this;
}

public Builder setLocation(Location location) {
this.creationLocation = location;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,6 @@ public Sequence<String> getConstraints(JavaInfo javaInfo) {
return StarlarkList.empty();
}

@Override
public JavaInfo removeAnnotationProcessors(JavaInfo javaInfo) {
// No implementation in Bazel. This method not callable in Starlark except through
// (discouraged) use of --experimental_google_legacy_api.
return null;
}

@Override
public JavaInfo setAnnotationProcessing(
JavaInfo javaInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,24 +500,6 @@ JavaInfoT addConstraints(JavaInfoT javaInfo, Sequence<?> constraints /* <String>
enableOnlyWithFlag = BuildLanguageOptions.EXPERIMENTAL_GOOGLE_LEGACY_API)
Sequence<String> getConstraints(JavaInfoT javaInfo);

// TODO(b/111090089): delete once java_common.compile(enable_annotation_processing) is available
@StarlarkMethod(
name = "experimental_disable_annotation_processing",
doc =
"Returns a copy of the given JavaInfo with any provided annotation processors disabled."
+ " Annotation processor classpaths are preserved in case they contain Error Prone"
+ " plugins, but processor names and data are excluded. For example, it can be"
+ " used to process the inputs to java_common.compile's deps and plugins parameters.",
parameters = {
@Param(
name = "java_info",
positional = true,
named = false,
doc = "The JavaInfo to process.")
},
enableOnlyWithFlag = BuildLanguageOptions.EXPERIMENTAL_GOOGLE_LEGACY_API)
JavaInfoT removeAnnotationProcessors(JavaInfoT javaInfo);

@StarlarkMethod(
name = "set_annotation_processing",
doc = "Returns a copy of the given JavaInfo with the given annotation_processing info.",
Expand Down

0 comments on commit d4dd203

Please sign in to comment.