diff options
author | Jooyung Han <jooyung@google.com> | 2020-03-23 20:21:11 +0900 |
---|---|---|
committer | Jooyung Han <jooyung@google.com> | 2020-04-25 02:25:39 +0900 |
commit | 65cd0f0caafb2ff9f558c46b7a7502322b9c57a8 (patch) | |
tree | 27c86639188067cfaa973ad7e8f9021db92fdced /apex/apex_test.go | |
parent | 40b286ceea0f52db222f3c57a3f289edb92ad512 (diff) | |
download | build_soong-65cd0f0caafb2ff9f558c46b7a7502322b9c57a8.tar.gz build_soong-65cd0f0caafb2ff9f558c46b7a7502322b9c57a8.tar.bz2 build_soong-65cd0f0caafb2ff9f558c46b7a7502322b9c57a8.zip |
apex: respect filename property for apk-in-apex
android_app_import supports filename: property, which overrides .apk
filename.
Now, apex packaging rule respects it too.
(Previously, apex packaging ignored it)
Bug: 152163837
Test: m (soong tests amended)
Merged-In: I72e2f1c923f4d01c42a87bf2232a025adca4c918
Change-Id: I72e2f1c923f4d01c42a87bf2232a025adca4c918
(cherry picked from commit 39ee119de2a246f5de07670c225094a8b4efd563)
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 35a07c8c..eed0d72f 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -3413,6 +3413,7 @@ func TestApexWithAppImports(t *testing.T) { dex_preopt: { enabled: false, }, + filename: "AwesomePrebuiltAppFooPriv.apk", } `) @@ -3421,7 +3422,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) { @@ -3754,7 +3795,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() |