From ead44955c5cf02d94152f2cf3462c40ee6659594 Mon Sep 17 00:00:00 2001 From: ilist Date: Mon, 9 Aug 2021 12:03:43 -0700 Subject: [PATCH] Use JavaPluginInfo provider from Android databinding annotation processor. The annotation processor is a java_plugin, which will stop returning JavaInfo and return only JavaPluginInfo. PiperOrigin-RevId: 389691475 --- .../rules/android/databinding/DataBindingV1Context.java | 8 ++++---- .../rules/android/databinding/DataBindingV2Context.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV1Context.java b/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV1Context.java index 3464e03847e461..41d0c1ee05ddf8 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV1Context.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV1Context.java @@ -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; @@ -77,9 +76,10 @@ public void supplyAnnotationProcessor( RuleContext ruleContext, BiConsumer> 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 annotationProcessorOutputs = DataBinding.getMetadataOutputs(ruleContext, useUpdatedArgs, metadataOutputSuffixes); diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV2Context.java b/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV2Context.java index 988d7a03e9cc68..ac665060f58eb6 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV2Context.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/databinding/DataBindingV2Context.java @@ -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; @@ -139,9 +138,10 @@ public void supplyAnnotationProcessor( RuleContext ruleContext, BiConsumer> 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 annotationProcessorOutputs = DataBinding.getMetadataOutputs(ruleContext, useUpdatedArgs, metadataOutputSuffixes);