aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java
diff options
context:
space:
mode:
authorGravatar asteinb <asteinb@google.com>2018-04-13 12:21:12 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-13 12:24:31 -0700
commit445fb097b82aae3b2e5736aea540ecb907d5f052 (patch)
treea69f7a22a042bd9cec3b01d5a567fcd9f376d59c /src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java
parent10d9155d6b1fad5c05c5872fb917cc77fbc61810 (diff)
Resource-only merge action
Create wrapper for merged resources, and methods to make it from parsed resources. Currently just reuse the ResourceDependencies class to provide resource dependencies; we could create an interface and another class, but this class is good enough (and will be resource-specific once we finish decoupling assets, resources, and manifests). Note that, like the previous parse action, merging sometimes has a dependency on the stamped manifest, so resources and manifests will only be mostly decoupled. Also, make the merge action not require an output manifest for cases like this. RELNOTES: none PiperOrigin-RevId: 192805891
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java
index efc3229e9b..48e8a47f1c 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java
@@ -100,8 +100,8 @@ public class AndroidResources {
}
/**
- * Validates that there are no targets with resources in the srcs, as they
- * should not be used with the Android data logic.
+ * Validates that there are no targets with resources in the srcs, as they should not be used with
+ * the Android data logic.
*/
private static void validateNoAndroidResourcesInSources(RuleContext ruleContext)
throws RuleErrorException {
@@ -128,8 +128,7 @@ public class AndroidResources {
}
ImmutableList<Artifact> resources =
- getResources(
- ruleContext.getPrerequisites(resourcesAttr, Mode.TARGET, FileProvider.class));
+ getResources(ruleContext.getPrerequisites(resourcesAttr, Mode.TARGET, FileProvider.class));
return forResources(ruleContext, resources, resourcesAttr);
}
@@ -385,15 +384,14 @@ public class AndroidResources {
getResourceRoots(errorConsumer, filtered.get(), DEFAULT_RESOURCES_ATTR)));
}
- public ParsedAndroidResources parse(
- RuleContext ruleContext,
- StampedAndroidManifest manifest) throws InterruptedException, RuleErrorException {
+ public ParsedAndroidResources parse(RuleContext ruleContext, StampedAndroidManifest manifest)
+ throws InterruptedException, RuleErrorException {
return ParsedAndroidResources.parseFrom(ruleContext, this, manifest);
}
@Override
public boolean equals(Object object) {
- if (!(object instanceof AndroidResources)) {
+ if (object == null || getClass() != object.getClass()) {
return false;
}