From c69068ae603385d91bc02986a48006712a1302b0 Mon Sep 17 00:00:00 2001 From: ajmichael Date: Fri, 1 Dec 2017 13:26:09 -0800 Subject: Move IDL constant out of AndroidSemantics AndroidSemantics is for "pluggability". Defining static constants on the interface does not do that. Furthermore, output group names are not something we would want to change between internal and external. RELNOTES: None PiperOrigin-RevId: 177632488 --- .../devtools/build/lib/rules/android/AndroidIdlHelper.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdlHelper.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdlHelper.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdlHelper.java index 4713a4722a..ede1889c6f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdlHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdlHelper.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.ParameterFile.ParameterFileType; +import com.google.devtools.build.lib.analysis.OutputGroupProvider; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; @@ -47,6 +48,13 @@ import javax.annotation.Nullable; */ public class AndroidIdlHelper { + /** + * Name of the output group used for idl jars (the jars containing the class files for sources + * generated from annotation processors). + */ + static final String IDL_JARS_OUTPUT_GROUP = + OutputGroupProvider.HIDDEN_OUTPUT_GROUP_PREFIX + "idl_jars"; + private final RuleContext ruleContext; private final AndroidIdlProvider androidIdlProvider; private final Map translatedIdlSources; @@ -102,9 +110,8 @@ public class AndroidIdlHelper { manifestProtoOutput, idlClassJar, idlSourceJar); } builder - .add(AndroidIdlProvider.class, androidIdlProvider) - .addOutputGroup( - AndroidSemantics.IDL_JARS_OUTPUT_GROUP, androidIdlProvider.getTransitiveIdlJars()); + .addProvider(AndroidIdlProvider.class, androidIdlProvider) + .addOutputGroup(IDL_JARS_OUTPUT_GROUP, androidIdlProvider.getTransitiveIdlJars()); } /** -- cgit v1.2.3