Merge "apex: respect filename property for apk-in-apex"

This commit is contained in:
Jooyung Han
2020-04-18 02:23:07 +00:00
committed by Gerrit Code Review
3 changed files with 62 additions and 12 deletions

View File

@@ -3438,6 +3438,7 @@ func TestApexWithAppImports(t *testing.T) {
dex_preopt: {
enabled: false,
},
filename: "AwesomePrebuiltAppFooPriv.apk",
}
`)
@@ -3446,7 +3447,47 @@ func TestApexWithAppImports(t *testing.T) {
copyCmds := apexRule.Args["copy_commands"]
ensureContains(t, copyCmds, "image.apex/app/AppFooPrebuilt/AppFooPrebuilt.apk")
ensureContains(t, copyCmds, "image.apex/priv-app/AppFooPrivPrebuilt/AppFooPrivPrebuilt.apk")
ensureContains(t, copyCmds, "image.apex/priv-app/AppFooPrivPrebuilt/AwesomePrebuiltAppFooPriv.apk")
}
func TestApexWithAppImportsPrefer(t *testing.T) {
ctx, _ := testApex(t, `
apex {
name: "myapex",
key: "myapex.key",
apps: [
"AppFoo",
],
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
android_app {
name: "AppFoo",
srcs: ["foo/bar/MyClass.java"],
sdk_version: "none",
system_modules: "none",
apex_available: [ "myapex" ],
}
android_app_import {
name: "AppFoo",
apk: "AppFooPrebuilt.apk",
filename: "AppFooPrebuilt.apk",
presigned: true,
prefer: true,
}
`, withFiles(map[string][]byte{
"AppFooPrebuilt.apk": nil,
}))
ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{
"app/AppFoo/AppFooPrebuilt.apk",
})
}
func TestApexWithTestHelperApp(t *testing.T) {
@@ -3779,7 +3820,7 @@ func TestOverrideApex(t *testing.T) {
copyCmds := apexRule.Args["copy_commands"]
ensureNotContains(t, copyCmds, "image.apex/app/app/app.apk")
ensureContains(t, copyCmds, "image.apex/app/app/override_app.apk")
ensureContains(t, copyCmds, "image.apex/app/override_app/override_app.apk")
apexBundle := module.Module().(*apexBundle)
name := apexBundle.Name()