aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-04-09 13:21:04 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-09 13:22:16 -0700
commit7edc5d49c8e764ab2bdf19e3a9fb58ea30fa708f (patch)
tree1537362342f9138eeb2c7d61d9cb7ad2b05e1dc2
parentc5a080b7e69062e4130c9921381a6b08f6dcda20 (diff)
Remove the Blaze strict java deps exemption for Android databinding. Use the JavaBuilder processor exemption list instead of disabling strict deps for the affected rules outright. This narrows the degree to which the exemption is applied, and prevents other strict deps violations from accruing on targets that enable databinding.
PiperOrigin-RevId: 192176621
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java14
1 files changed, 1 insertions, 13 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 3bb8df4839..8c638aa3c9 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
@@ -574,19 +574,7 @@ public class AndroidCommon {
javaCommon.getJavacOpts(),
attributes,
useDataBinding ? DataBinding.processDeps(ruleContext) : ImmutableList.<Artifact>of(),
- /* We have to disable strict deps checking with data binding because data binding
- * propagates layout XML up the dependency chain. Say a library's XML references a Java
- * class, e.g.: "<variable type="some.package.SomeClass" />". Data binding's annotation
- * processor triggers a compile against SomeClass. Because data binding reprocesses
- * bindings each step up the dependency chain (via merged resources), that means this
- * compile also happens at the top-level binary. Since SomeClass.java is declared in the
- * library, this creates a strict deps violation.
- *
- * This weakening of strict deps is unfortunate and deserves to be fixed. Once data
- * binding integrates with aapt2 this problem should naturally go away (since
- * reprocessing will no longer happen).
- */
- /*disableStrictDeps=*/ useDataBinding);
+ /*disableStrictDeps=*/ false);
helper.addLibrariesToAttributes(javaCommon.targetsTreatedAsDeps(ClasspathType.COMPILE_ONLY));
attributes.setTargetLabel(ruleContext.getLabel());