aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java
diff options
context:
space:
mode:
authorGravatar asteinb <asteinb@google.com>2018-05-08 13:58:47 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-08 14:01:11 -0700
commitfbdf70e6cc1a406f113e802abd24b3da25154435 (patch)
tree9c8e64acfc457582d7dc9979cc191065b376e204 /src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java
parente3784eccef5ff6b1db35186e763a2b3d1dd3ef54 (diff)
Expose R.class as a JavaInfo
The R.class file, when available, is used in Java compilation. So it should be exposed in its own provider as an output of resource processing. The R.class file is marked as Neverlink and compiletime-only to ensure it doesn't get inherited. Change resource processing to return a SkylarkDict of providers. That way, callers can easily get the provider they want, or use values() to get all the providers. Stop exposing R.class in AndroidResourcesInfo since we're exposing it in an easier-to-consume way now. Will update other methods that return multiple providers to do the same in future reviews. RELNOTES: none PiperOrigin-RevId: 195871587
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java
index 1631db5992..0a62aea8d2 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceDependencies.java
@@ -254,14 +254,12 @@ public final class ResourceDependencies {
.toInfo(
newDirectResource.getLabel(),
newDirectResource.getProcessedManifest(),
- newDirectResource.getRTxt(),
- newDirectResource.getJavaClassJar());
+ newDirectResource.getRTxt());
}
return new AndroidResourcesInfo(
newDirectResource.getLabel(),
newDirectResource.getProcessedManifest(),
newDirectResource.getRTxt(),
- newDirectResource.getJavaClassJar(),
NestedSetBuilder.<ValidatedAndroidData>naiveLinkOrder()
.addTransitive(transitiveResourceContainers)
.addTransitive(directResourceContainers)
@@ -294,15 +292,14 @@ public final class ResourceDependencies {
* @return A provider with the current resources and label.
*/
public AndroidResourcesInfo toInfo(
- Label label, ProcessedAndroidManifest manifest, Artifact rTxt, @Nullable Artifact rClassJar) {
+ Label label, ProcessedAndroidManifest manifest, Artifact rTxt) {
if (neverlink) {
- return ResourceDependencies.empty().toInfo(label, manifest, rTxt, rClassJar);
+ return ResourceDependencies.empty().toInfo(label, manifest, rTxt);
}
return new AndroidResourcesInfo(
label,
manifest,
rTxt,
- rClassJar,
transitiveResourceContainers,
directResourceContainers,
transitiveResources,