Skip to content

Commit

Permalink
Use JavaPluginInfo provider from Android databinding annotation proce…
Browse files Browse the repository at this point in the history
…ssor.

The annotation processor is a java_plugin, which will stop returning JavaInfo and return only JavaPluginInfo.

PiperOrigin-RevId: 389691475
  • Loading branch information
comius authored and copybara-github committed Aug 9, 2021
1 parent 14e4a78 commit ead4495
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.devtools.build.lib.rules.android.AndroidCommon;
import com.google.devtools.build.lib.rules.android.AndroidDataContext;
import com.google.devtools.build.lib.rules.android.AndroidResources;
import com.google.devtools.build.lib.rules.java.JavaInfo;
import com.google.devtools.build.lib.rules.java.JavaPluginInfo;
import java.util.List;
import java.util.function.BiConsumer;
Expand Down Expand Up @@ -77,9 +76,10 @@ public void supplyAnnotationProcessor(
RuleContext ruleContext, BiConsumer<JavaPluginInfo, Iterable<Artifact>> consumer) {

JavaPluginInfo javaPluginInfo =
JavaInfo.getJavaInfo(
ruleContext.getPrerequisite(DataBinding.DATABINDING_ANNOTATION_PROCESSOR_ATTR))
.getJavaPluginInfo();
(JavaPluginInfo)
ruleContext
.getPrerequisite(DataBinding.DATABINDING_ANNOTATION_PROCESSOR_ATTR)
.get(JavaPluginInfo.PROVIDER.getKey());

ImmutableList<Artifact> annotationProcessorOutputs =
DataBinding.getMetadataOutputs(ruleContext, useUpdatedArgs, metadataOutputSuffixes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import com.google.devtools.build.lib.rules.android.AndroidDataBindingProcessorBuilder;
import com.google.devtools.build.lib.rules.android.AndroidDataContext;
import com.google.devtools.build.lib.rules.android.AndroidResources;
import com.google.devtools.build.lib.rules.java.JavaInfo;
import com.google.devtools.build.lib.rules.java.JavaPluginInfo;
import com.google.devtools.build.lib.starlarkbuildapi.android.DataBindingV2ProviderApi;
import com.google.devtools.build.lib.starlarkbuildapi.android.DataBindingV2ProviderApi.LabelJavaPackagePair;
Expand Down Expand Up @@ -139,9 +138,10 @@ public void supplyAnnotationProcessor(
RuleContext ruleContext, BiConsumer<JavaPluginInfo, Iterable<Artifact>> consumer) {

JavaPluginInfo javaPluginInfo =
JavaInfo.getJavaInfo(
ruleContext.getPrerequisite(DataBinding.DATABINDING_ANNOTATION_PROCESSOR_ATTR))
.getJavaPluginInfo();
(JavaPluginInfo)
ruleContext
.getPrerequisite(DataBinding.DATABINDING_ANNOTATION_PROCESSOR_ATTR)
.get(JavaPluginInfo.PROVIDER.getKey());

ImmutableList<Artifact> annotationProcessorOutputs =
DataBinding.getMetadataOutputs(ruleContext, useUpdatedArgs, metadataOutputSuffixes);
Expand Down

0 comments on commit ead4495

Please sign in to comment.