aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android
diff options
context:
space:
mode:
authorGravatar plf <plf@google.com>2018-05-25 06:30:19 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-25 06:31:24 -0700
commitfd260c56b46fbf68a07b29b0fc1b8cdecc4fe854 (patch)
tree4ede85a2e80ce1fd55037fe89099f32b0dab1de9 /src/main/java/com/google/devtools/build/lib/rules/android
parentedd539809a7a8801c529108827c851338f5ed354 (diff)
Automated rollback of commit 14c6d8edadb474cb72f5307b531a2699770f02d0.
*** Reason for rollback *** Crashes lots of targets in nightly blaze-2018.05.24-1: PiperOrigin-RevId: 198041861
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidDataContext.java24
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/ProcessedAndroidData.java2
2 files changed, 18 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDataContext.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDataContext.java
index 8d52db5e90..e894fbc2c9 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDataContext.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDataContext.java
@@ -43,6 +43,8 @@ import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
+ " manifests")
public class AndroidDataContext {
+ private final RuleContext ruleContext;
+
private final Label label;
private final ActionConstructionContext actionConstructionContext;
private final FilesToRunProvider busybox;
@@ -54,19 +56,16 @@ public class AndroidDataContext {
public static AndroidDataContext makeContext(RuleContext ruleContext) {
return new AndroidDataContext(
- ruleContext.getLabel(),
ruleContext,
ruleContext.getExecutablePrerequisite("$android_resources_busybox", Mode.HOST),
AndroidSdkProvider.fromRuleContext(ruleContext));
}
protected AndroidDataContext(
- Label label,
- ActionConstructionContext actionConstructionContext,
- FilesToRunProvider busybox,
- AndroidSdkProvider sdk) {
- this.label = label;
- this.actionConstructionContext = actionConstructionContext;
+ RuleContext ruleContext, FilesToRunProvider busybox, AndroidSdkProvider sdk) {
+ this.ruleContext = ruleContext;
+ this.label = ruleContext.getLabel();
+ this.actionConstructionContext = ruleContext;
this.busybox = busybox;
this.sdk = sdk;
}
@@ -87,6 +86,17 @@ public class AndroidDataContext {
return sdk;
}
+ /**
+ * Gets the current RuleContext.
+ *
+ * @deprecated RuleContext is only exposed to help migrate away from it. New code should only be
+ * written using other methods from this class.
+ */
+ @Deprecated
+ public RuleContext getRuleContext() {
+ return ruleContext;
+ }
+
/*
* Convenience methods. These are just slightly cleaner ways of doing common tasks.
*/
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ProcessedAndroidData.java b/src/main/java/com/google/devtools/build/lib/rules/android/ProcessedAndroidData.java
index 0a1871051a..a9d4267978 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/ProcessedAndroidData.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/ProcessedAndroidData.java
@@ -90,7 +90,7 @@ public class ProcessedAndroidData {
.conditionalKeepRules(conditionalKeepRules)
.setDataBindingInfoZip(
dataBindingEnabled
- ? DataBinding.getLayoutInfoFile(dataContext.getActionConstructionContext())
+ ? DataBinding.getLayoutInfoFile(dataContext.getRuleContext())
: null)
.setFeatureOf(featureOf)
.setFeatureAfter(featureAfter);