diff options
author | 2020-06-24 23:50:26 +0900 | |
---|---|---|
committer | 2020-06-25 15:37:47 +0900 | |
commit | 85d61767b579eb2dc92fe4f15861437ceee57e18 (patch) | |
tree | 50dae89ed2cf6df8fc43b57283be0109f2e21b3a /apex/apex_test.go | |
parent | 2ed99d00b4acb570e6a312fc9ef2e2f42f510fb8 (diff) |
apex: support "vendor: true"
When an apex sets "vendor: true", it becomes a vendor apex.
Vendor apexes use vendor variants for native modules and are
installed in /vendor/apex.
Bug: 159211312
Test: m
Change-Id: I2585dd990ba857a2ab3ec6ab24e09d4652e867f2
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 3cd7d1b36..d5eb45761 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -2105,7 +2105,7 @@ func TestUseVendor(t *testing.T) { ensureNotContains(t, inputsString, "android_arm64_armv8-a_shared_myapex/mylib2.so") } -func TestUseVendorRestriction(t *testing.T) { +func TestUseVendorNotAllowedForSystemApexes(t *testing.T) { testApexError(t, `module "myapex" .*: use_vendor: not allowed`, ` apex { name: "myapex", @@ -2161,6 +2161,47 @@ func TestUseVendorFailsIfNotVendorAvailable(t *testing.T) { `) } +func TestVendorApex(t *testing.T) { + ctx, config := testApex(t, ` + apex { + name: "myapex", + key: "myapex.key", + binaries: ["mybin"], + vendor: true, + } + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + cc_binary { + name: "mybin", + vendor: true, + shared_libs: ["libfoo"], + } + cc_library { + name: "libfoo", + proprietary: true, + } + `) + + ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{ + "bin/mybin", + "lib64/libfoo.so", + // TODO(b/159195575): Add an option to use VNDK libs from VNDK APEX + "lib64/libc++.so", + }) + + apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle) + data := android.AndroidMkDataForTest(t, config, "", apexBundle) + name := apexBundle.BaseModuleName() + prefix := "TARGET_" + var builder strings.Builder + data.Custom(&builder, name, prefix, "", data) + androidMk := builder.String() + ensureContains(t, androidMk, `LOCAL_MODULE_PATH := /tmp/target/product/test_device/vendor/apex`) +} + func TestAndroidMkWritesCommonProperties(t *testing.T) { ctx, config := testApex(t, ` apex { |