aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-05-04 23:15:00 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-05-05 19:10:24 +0000
commit88ccf0c9f490a5138719c3bb476b17eb1d8384e2 (patch)
treed5592d85c0f06d941b5f9dac26fccebf0190796f /src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java
parent1f2cb5c56291efab2989e6a342898560ebef3fca (diff)
[Android] Support aapt-generated main dex specs.
Add bazel support for using the "aapt -D" command to generate a proguard specification for components which need to be in the main dex. -- MOS_MIGRATED_REVID=121531584
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java
index 0b7bbfc4fc..505be25d3a 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceApk.java
@@ -26,15 +26,16 @@ import javax.annotation.Nullable;
*/
@Immutable
public final class ResourceApk {
- // TODO(bazel-team): The only field that is legitimately nullable is javaSrcJar. The rest is
- // marked as such due to .fromTransitiveResources(). It seems like there should be a better way
- // to do this.
+ // TODO(bazel-team): The only fields that are legitimately nullable are javaSrcJar and
+ // mainDexProguardConfig. The rest are marked as such due to .fromTransitiveResources().
+ // It seems like there should be a better way to do this.
@Nullable private final Artifact resourceApk; // The .ap_ file
@Nullable private final Artifact resourceJavaSrcJar; // Source jar containing R.java and friends
private final ResourceDependencies resourceDeps;
@Nullable private final ResourceContainer primaryResource;
@Nullable private final Artifact manifest; // The non-binary XML version of AndroidManifest.xml
@Nullable private final Artifact resourceProguardConfig;
+ @Nullable private final Artifact mainDexProguardConfig;
private final boolean legacy;
public ResourceApk(
@@ -44,6 +45,7 @@ public final class ResourceApk {
@Nullable ResourceContainer primaryResource,
@Nullable Artifact manifest,
@Nullable Artifact resourceProguardConfig,
+ @Nullable Artifact mainDexProguardConfig,
boolean legacy) {
this.resourceApk = resourceApk;
this.resourceJavaSrcJar = resourceJavaSrcJar;
@@ -51,6 +53,7 @@ public final class ResourceApk {
this.primaryResource = primaryResource;
this.manifest = manifest;
this.resourceProguardConfig = resourceProguardConfig;
+ this.mainDexProguardConfig = mainDexProguardConfig;
this.legacy = legacy;
}
@@ -76,13 +79,17 @@ public final class ResourceApk {
public static ResourceApk fromTransitiveResources(
ResourceDependencies resourceDeps) {
- return new ResourceApk(null, null, resourceDeps, null, null, null, false);
+ return new ResourceApk(null, null, resourceDeps, null, null, null, null, false);
}
public Artifact getResourceProguardConfig() {
return resourceProguardConfig;
}
+ public Artifact getMainDexProguardConfig() {
+ return mainDexProguardConfig;
+ }
+
public ResourceDependencies getResourceDependencies() {
return resourceDeps;
}