diff options
author | Jaewoong Jung <jungjw@google.com> | 2019-06-18 13:09:13 -0700 |
---|---|---|
committer | Jaewoong Jung <jungjw@google.com> | 2019-06-25 21:08:32 +0000 |
commit | d6585fe6e34b3181cdaec3892e5214dbf5d25d5e (patch) | |
tree | 672eff3134423d37ba11f50161040c0247f85aba /apex/apex_test.go | |
parent | 5c6572e53fa2810e45215850842b81b8fa9a22ec (diff) | |
download | android_build_soong-d6585fe6e34b3181cdaec3892e5214dbf5d25d5e.tar.gz android_build_soong-d6585fe6e34b3181cdaec3892e5214dbf5d25d5e.tar.bz2 android_build_soong-d6585fe6e34b3181cdaec3892e5214dbf5d25d5e.zip |
Embed NOTICE output as an APEX asset.
Instead of outputting an aggregated NOTICE file as an intermediate build
resource to allow Make to include it in the final system-wide NOTICE,
process and embed it as an asset in the final APEX. This allows us to
update the NOTICE contents automatically when an APEX is updated.
Fixes: 135218846
Test: Built mainline modules, apex_test.go
Change-Id: Ic851b330fe93be1f602907d44ecc7886c3b0171b
Merged-In: Ic851b330fe93be1f602907d44ecc7886c3b0171b
(cherry picked from commit 14f5ff62c952350a9e2b07d9d07429b9535655de)
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 200a1c29..c671e7c3 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -27,8 +27,11 @@ import ( "android/soong/java" ) +var buildDir string + func testApex(t *testing.T, bp string) *android.TestContext { - config, buildDir := setup(t) + var config android.Config + config, buildDir = setup(t) defer teardown(buildDir) ctx := android.NewTestArchContext() @@ -310,6 +313,8 @@ func TestBasicApex(t *testing.T) { optFlags := apexRule.Args["opt_flags"] ensureContains(t, optFlags, "--pubkey vendor/foo/devkeys/testkey.avbpubkey") + // Ensure that the NOTICE output is being packaged as an asset. + ensureContains(t, optFlags, "--assets_dir "+buildDir+"/.intermediates/myapex/android_common_myapex/NOTICE") copyCmds := apexRule.Args["copy_commands"] @@ -349,8 +354,8 @@ func TestBasicApex(t *testing.T) { mergeNoticesRule := ctx.ModuleForTests("myapex", "android_common_myapex").Rule("mergeNoticesRule") noticeInputs := mergeNoticesRule.Inputs.Strings() - if len(noticeInputs) != 4 { - t.Errorf("number of input notice files: expected = 4, actual = %q", len(noticeInputs)) + if len(noticeInputs) != 2 { + t.Errorf("number of input notice files: expected = 2, actual = %q", len(noticeInputs)) } ensureListContains(t, noticeInputs, "NOTICE") ensureListContains(t, noticeInputs, "custom_notice") |