diff options
author | 2019-03-18 12:01:38 +0900 | |
---|---|---|
committer | 2019-03-21 08:05:50 +0900 | |
commit | 52818fcde8265fd43ad5f331f57122ecdbe7a6be (patch) | |
tree | 9c0edd5e4f9dfcae48cb3f87ff0f10c11b3fa776 /apex/apex_test.go | |
parent | 5a3f31b28451717dd7e9d948bcaa5644de759b17 (diff) |
Notice support for APEX
Notice file for an APEX is created by merging notice files for the
modules included in it (plus the notice file for the APEX itself if
specified).
Notice files having the same content are not duplicated; it is emitted
only once.
Bug: 128701495
Test: m (apex_test is amended)
Test: m and inspect $(PRODUCT_OUT)/obj/NOTICE.txt to check there are
license entries for /system/apex/*.apex files
Change-Id: I169d91038291a6c71615de97cf5b03174afab5d4
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index f221cf228..ac2701f7e 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -159,6 +159,8 @@ func testApex(t *testing.T, bp string) *android.TestContext { "testkey.override.pk8": nil, "vendor/foo/devkeys/testkey.avbpubkey": nil, "vendor/foo/devkeys/testkey.pem": nil, + "NOTICE": nil, + "custom_notice": nil, }) _, errs := ctx.ParseFileList(".", []string{"Android.bp"}) android.FailIfErrored(t, errs) @@ -280,6 +282,7 @@ func TestBasicApex(t *testing.T) { srcs: ["mylib.cpp"], system_shared_libs: [], stl: "none", + notice: "custom_notice", } `) @@ -319,6 +322,14 @@ func TestBasicApex(t *testing.T) { if !good { t.Errorf("Could not find all expected symlinks! foo: %t, foo_link_64: %t. Command was %s", found_foo, found_foo_link_64, copyCmds) } + + apexMergeNoticeRule := ctx.ModuleForTests("myapex", "android_common_myapex").Rule("apexMergeNoticeRule") + noticeInputs := strings.Split(apexMergeNoticeRule.Args["inputs"], " ") + if len(noticeInputs) != 3 { + t.Errorf("number of input notice files: expected = 3, actual = %d", len(noticeInputs)) + } + ensureListContains(t, noticeInputs, "NOTICE") + ensureListContains(t, noticeInputs, "custom_notice") } func TestBasicZipApex(t *testing.T) { |