diff options
Diffstat (limited to 'src')
3 files changed, 25 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 f73ff4276b..cbebe5f8ad 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 @@ -771,7 +771,7 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { textProto, sdk, jars, - resourceApk.getArtifact(), + resourceApk, nativeLibs); 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 2494f07a2e..8218156465 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 @@ -38,7 +38,7 @@ public class ApkManifestAction extends AbstractFileWriteAction { private static Iterable<Artifact> makeInputs( AndroidSdkProvider sdk, Iterable<Artifact> jars, - Artifact resourceApk, + ResourceApk resourceApk, NativeLibs nativeLibs) { return ImmutableList.<Artifact>builder() @@ -60,7 +60,8 @@ public class ApkManifestAction extends AbstractFileWriteAction { .add(sdk.getZipalign().getExecutable()) .addAll(jars) - .add(resourceApk) + .add(resourceApk.getArtifact()) + .add(resourceApk.getManifest()) .addAll(nativeLibs.getAllNativeLibs()) .build(); } @@ -70,16 +71,26 @@ public class ApkManifestAction extends AbstractFileWriteAction { private final boolean textOutput; private final AndroidSdkProvider sdk; private final Iterable<Artifact> jars; - private final Artifact resourceApk; + private final ResourceApk resourceApk; private final NativeLibs nativeLibs; + /** + * @param owner The action owner. + * @param outputFile The artifact to write the proto to. + * @param textOutput Whether to make the + * @param sdk The Android SDK. + * @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 nativeLibs The natives libs that would go into an APK. + */ public ApkManifestAction( ActionOwner owner, Artifact outputFile, boolean textOutput, AndroidSdkProvider sdk, Iterable<Artifact> jars, - Artifact resourceApk, + ResourceApk resourceApk, NativeLibs nativeLibs) { super(owner, makeInputs(sdk, jars, resourceApk, nativeLibs), outputFile, false); @@ -124,7 +135,7 @@ public class ApkManifestAction extends AbstractFileWriteAction { private ApkManifestCreator(MetadataHandler metadataHandler) { this.metadataHandler = metadataHandler; } - + private ApkManifest createManifest() throws IOException { ApkManifest.Builder manifestBuilder = ApkManifest.newBuilder(); @@ -132,7 +143,8 @@ public class ApkManifestAction extends AbstractFileWriteAction { manifestBuilder.addJars(makeArtifactProto(jar)); } - manifestBuilder.setResourceApk(makeArtifactProto(resourceApk)); + manifestBuilder.setResourceApk(makeArtifactProto(resourceApk.getArtifact())); + manifestBuilder.setAndroidManifest(makeArtifactProto(resourceApk.getManifest())); for (Map.Entry<String, Iterable<Artifact>> nativeLib : nativeLibs.getMap().entrySet()) { if (!Iterables.isEmpty(nativeLib.getValue())) { diff --git a/src/main/protobuf/apk_manifest.proto b/src/main/protobuf/apk_manifest.proto index 7d3ee9c633..919d82647d 100644 --- a/src/main/protobuf/apk_manifest.proto +++ b/src/main/protobuf/apk_manifest.proto @@ -49,8 +49,14 @@ message AndroidSdk { } message ApkManifest { + // Information about the AndroidSdk AndroidSdk android_sdk = 1; + // All the jars containing the classes that would be dex and go into the APK repeated Artifact jars = 2; + // The .ap_ that contains the resources that go into the APK Artifact resource_apk = 3; + // The native library files that go into the APK repeated NativeLib native_lib = 4; + // The final merged AndroidManifest.xml file (in text, i.e. non-binary, XML) + Artifact android_manifest = 5; } |