diff options
author | 2017-04-12 17:40:13 +0000 | |
---|---|---|
committer | 2017-04-13 09:36:49 +0200 | |
commit | 276591254da669286dbb49a8c9c3328299354300 (patch) | |
tree | a2511eee27200fb71efca570dee2e3e422caba87 /src/main/java/com/google/devtools/build/lib/rules | |
parent | 2d5d17b221574583f3503fe536c7240c168311da (diff) |
Make Android data binding rules explicitly depend on the runtime library.
Before this change Bazel was adding this implicitly. But that wasn't
working properly with --incremental_dexing. And that implementation is a
lot messier and bug-prone vs. just including it as a standard dependency.
Issue: #2694
PiperOrigin-RevId: 152956638
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java | 10 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/DataBinding.java | 21 |
2 files changed, 2 insertions, 29 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java index 3f1b60998c..e3f2417cd7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java @@ -918,19 +918,13 @@ public class AndroidCommon { if (isLibrary) { compileDeps = JavaCommon.defaultDeps(ruleContext, semantics, ClasspathType.COMPILE_ONLY); - if (useDataBinding) { - compileDeps = DataBinding.addSupportLibs(ruleContext, compileDeps); - } compileDeps = AndroidIdlHelper.maybeAddSupportLibs(ruleContext, compileDeps); runtimeDeps = JavaCommon.defaultDeps(ruleContext, semantics, ClasspathType.RUNTIME_ONLY); bothDeps = JavaCommon.defaultDeps(ruleContext, semantics, ClasspathType.BOTH); } else { // Binary: - List<? extends TransitiveInfoCollection> ruleDeps = - ruleContext.getPrerequisites("deps", RuleConfiguredTarget.Mode.TARGET); - compileDeps = useDataBinding - ? DataBinding.addSupportLibs(ruleContext, ruleDeps) - : ImmutableList.<TransitiveInfoCollection>copyOf(ruleDeps); + compileDeps = ImmutableList.copyOf( + ruleContext.getPrerequisites("deps", RuleConfiguredTarget.Mode.TARGET)); runtimeDeps = compileDeps; bothDeps = compileDeps; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/DataBinding.java b/src/main/java/com/google/devtools/build/lib/rules/android/DataBinding.java index a66d4b186c..6b74a7270d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/DataBinding.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/DataBinding.java @@ -19,7 +19,6 @@ import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.RuleConfiguredTarget; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; import com.google.devtools.build.lib.analysis.RuleContext; -import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.actions.FileWriteAction; import com.google.devtools.build.lib.analysis.actions.SymlinkAction; import com.google.devtools.build.lib.cmdline.Label; @@ -62,11 +61,6 @@ import java.util.List; */ public final class DataBinding { /** - * The rule attribute supplying the data binding runtime/compile-time support libraries. - */ - private static final String DATABINDING_RUNTIME_ATTR = "$databinding_runtime"; - - /** * The rule attribute supplying the data binding annotation processor. */ private static final String DATABINDING_ANNOTATION_PROCESSOR_ATTR = @@ -162,21 +156,6 @@ public final class DataBinding { } /** - * Adds the support libraries needed to compile/run Java code with data binding. - * - * <p>This excludes the annotation processor, which is injected separately as a Java plugin - * (see {@link #addAnnotationProcessor}). - */ - static ImmutableList<TransitiveInfoCollection> addSupportLibs(RuleContext ruleContext, - List<? extends TransitiveInfoCollection> deps) { - RuleConfiguredTarget.Mode mode = RuleConfiguredTarget.Mode.TARGET; - return ImmutableList.<TransitiveInfoCollection>builder() - .addAll(deps) - .addAll(ruleContext.getPrerequisites(DATABINDING_RUNTIME_ATTR, mode)) - .build(); - } - - /** * Adds data binding's annotation processor as a plugin to the given Java compilation context. * * <p>This, in conjunction with {@link #createAnnotationFile} extends the Java compilation to |