diff options
author | Alex Humesky <ahumesky@google.com> | 2016-06-09 23:19:09 +0000 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2016-06-10 07:52:34 +0000 |
commit | 3247ab416e37a3de1f08f6be81805e55250f09b8 (patch) | |
tree | b5d27008b3fa8b086abc05cab1ccfeb3bccd59af /src/main/java/com/google/devtools/build/lib | |
parent | 7300e89789524c2abae93075bead6d25f9eba3d6 (diff) |
Adds the path to the debug keystore to the apk_manifest.
--
MOS_MIGRATED_REVID=124510100
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java | 13 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/ApkManifestAction.java | 13 |
2 files changed, 19 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java index 0bb7ebb78e..e31c1bb90d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java @@ -628,6 +628,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { .add(splitDeployInfo) .build(); + Artifact debugKeystore = androidSemantics.getApkDebugSigningKey(ruleContext); Artifact apkManifest = ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.APK_MANIFEST); createApkManifestAction( @@ -637,7 +638,8 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { androidCommon, resourceClasses, resourceApk, - nativeLibs); + nativeLibs, + debugKeystore); Artifact apkManifestText = ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.APK_MANIFEST_TEXT); @@ -648,7 +650,8 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { androidCommon, resourceClasses, resourceApk, - nativeLibs); + nativeLibs, + debugKeystore); androidCommon.addTransitiveInfoProviders( builder, androidSemantics, resourceApk, zipAlignedApk, apksUnderTest); @@ -818,7 +821,8 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { AndroidCommon androidCommon, JavaTargetAttributes resourceClasses, ResourceApk resourceApk, - NativeLibs nativeLibs) { + NativeLibs nativeLibs, + Artifact debugKeystore) { Iterable<Artifact> jars = IterablesChain.concat( resourceClasses.getArchiveInputs(true), androidCommon.getRuntimeJars()); @@ -832,7 +836,8 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { sdk, jars, resourceApk, - nativeLibs); + nativeLibs, + debugKeystore); ruleContext.registerAction(manifestAction); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ApkManifestAction.java b/src/main/java/com/google/devtools/build/lib/rules/android/ApkManifestAction.java index a378988d85..3a8294e624 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/ApkManifestAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/ApkManifestAction.java @@ -42,7 +42,8 @@ public final class ApkManifestAction extends AbstractFileWriteAction { AndroidSdkProvider sdk, Iterable<Artifact> jars, ResourceApk resourceApk, - NativeLibs nativeLibs) { + NativeLibs nativeLibs, + Artifact debugKeystore) { return ImmutableList.<Artifact>builder() .add(sdk.getAapt().getExecutable()) @@ -66,6 +67,7 @@ public final class ApkManifestAction extends AbstractFileWriteAction { .add(resourceApk.getArtifact()) .add(resourceApk.getManifest()) .addAll(nativeLibs.getAllNativeLibs()) + .add(debugKeystore) .build(); } @@ -76,6 +78,7 @@ public final class ApkManifestAction extends AbstractFileWriteAction { private final Iterable<Artifact> jars; private final ResourceApk resourceApk; private final NativeLibs nativeLibs; + private final Artifact debugKeystore; /** * @param owner The action owner. @@ -85,6 +88,7 @@ public final class ApkManifestAction extends AbstractFileWriteAction { * @param jars All the jars that would be merged and dexed and put into an APK. * @param resourceApk The ResourceApk for the .ap_ that contains the resources that would go into * an APK. + * @param debugKeystore The debug keystore. * @param nativeLibs The natives libs that would go into an APK. */ public ApkManifestAction( @@ -94,14 +98,16 @@ public final class ApkManifestAction extends AbstractFileWriteAction { AndroidSdkProvider sdk, Iterable<Artifact> jars, ResourceApk resourceApk, - NativeLibs nativeLibs) { - super(owner, makeInputs(sdk, jars, resourceApk, nativeLibs), outputFile, false); + NativeLibs nativeLibs, + Artifact debugKeystore) { + super(owner, makeInputs(sdk, jars, resourceApk, nativeLibs, debugKeystore), outputFile, false); CollectionUtils.checkImmutable(jars); this.textOutput = textOutput; this.sdk = sdk; this.jars = jars; this.resourceApk = resourceApk; this.nativeLibs = nativeLibs; + this.debugKeystore = debugKeystore; } @Override @@ -191,6 +197,7 @@ public final class ApkManifestAction extends AbstractFileWriteAction { } manifestBuilder.setAndroidSdk(createAndroidSdk(sdk)); + manifestBuilder.setDebugKeystore(makeArtifactProto(debugKeystore)); return manifestBuilder.build(); } |