diff options
author | 2016-06-03 05:25:21 +0000 | |
---|---|---|
committer | 2016-06-03 12:53:56 +0000 | |
commit | ba323b9af3a1c6759afb9623c69a40aea001abf3 (patch) | |
tree | 9be1bef6a1a9652bb09b000feca0f85389936a8b /src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java | |
parent | f1be207b9e1942e4b5cd18dcff98ccb447e4eb6a (diff) |
Add resource_jar to android_studio_info.proto.
The IDE currently extracts these from the output jars by
a fragile string comparison. This will allow the IDE to
do so more robustly (eg. in case the resource jar output is renamed).
--
MOS_MIGRATED_REVID=123939803
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java index d39365a17a..39f8ba9f7a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java @@ -22,6 +22,7 @@ import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.packages.AttributeMap; +import com.google.devtools.build.lib.rules.java.JavaRuleOutputJarsProvider.OutputJar; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.vfs.PathFragment; @@ -128,6 +129,7 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { private Artifact apk = null; private Artifact idlClassJar = null; private Artifact idlSourceJar = null; + private OutputJar resourceJar = null; private String javaPackage = null; private final Set<SourceDirectory> resourceDirs = new LinkedHashSet<>(); private final Set<SourceDirectory> assetDirs = new LinkedHashSet<>(); @@ -145,6 +147,7 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { apk, idlClassJar, idlSourceJar, + resourceJar, definesAndroidResources, ImmutableList.copyOf(assetDirs), ImmutableList.copyOf(resourceDirs), @@ -194,6 +197,11 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { return this; } + public Builder setResourceJar(OutputJar resourceJar) { + this.resourceJar = resourceJar; + return this; + } + /** * Add "idl_srcs" contents. */ @@ -280,6 +288,7 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { private final Artifact signedApk; @Nullable private final Artifact idlClassJar; @Nullable private final Artifact idlSourceJar; + @Nullable private final OutputJar resourceJar; private final ImmutableCollection<SourceDirectory> resourceDirs; private final boolean definesAndroidResources; private final ImmutableCollection<SourceDirectory> assetDirs; @@ -295,6 +304,7 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { @Nullable Artifact signedApk, @Nullable Artifact idlClassJar, @Nullable Artifact idlSourceJar, + @Nullable OutputJar resourceJar, boolean definesAndroidResources, ImmutableCollection<SourceDirectory> assetDirs, ImmutableCollection<SourceDirectory> resourceDirs, @@ -308,6 +318,7 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { this.signedApk = signedApk; this.idlClassJar = idlClassJar; this.idlSourceJar = idlSourceJar; + this.resourceJar = resourceJar; this.definesAndroidResources = definesAndroidResources; this.assetDirs = assetDirs; this.resourceDirs = resourceDirs; @@ -358,6 +369,11 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { return idlSourceJar; } + @Nullable + public OutputJar getResourceJar() { + return resourceJar; + } + /** A list of the direct Resource directories. */ public ImmutableCollection<SourceDirectory> getResourceDirs() { return resourceDirs; |