diff options
author | 2024-10-15 19:27:41 +0000 | |
---|---|---|
committer | 2024-10-15 23:56:13 +0000 | |
commit | 72d86c62eae916be20c0aa97adb405fbb2a38bf6 (patch) | |
tree | 26ca0b801a2ad5f701586de1c3b71ac5fdbca8cf /apex | |
parent | 73162698940d5914314143013659ef80a289b6be (diff) |
Do not install internal files of apex
The motivation for this is to prevent the internal deps of apexes from
being installed in the top-level `android_filesystem`.
This CL does not get rid of the internal androidmk modules created by
apexes. Symbols listed in `LOCAL_SOONG_JNI_LIBS_SYMBOLS` will be copied
to $PRODUCT_OUT/apex/<apex> if <apex> is built. However, these
additional files will not be registed in ctx.packagingSpecs of the apex.
Test: go test ./apex
Test: no changes in the merged `jacoco-report-classes-all.jar` of
coverage builds
Change-Id: I5ca4b8069af6c4b464fd13e9a6553379eef3a57b
Diffstat (limited to 'apex')
-rw-r--r-- | apex/apex_test.go | 39 | ||||
-rw-r--r-- | apex/builder.go | 3 |
2 files changed, 41 insertions, 1 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 645778b10..68978b2e8 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -11861,3 +11861,42 @@ func TestApexSSCPJarMustBeInSamePartitionAsApex(t *testing.T) { dexpreopt.FixtureSetApexSystemServerJars("myapex:foo"), ) } + +// partitions should not package the artifacts that are included inside the apex. +func TestFilesystemWithApexDeps(t *testing.T) { + t.Parallel() + result := testApex(t, ` + android_filesystem { + name: "myfilesystem", + deps: ["myapex"], + } + apex { + name: "myapex", + key: "myapex.key", + binaries: ["binfoo"], + native_shared_libs: ["libfoo"], + apps: ["appfoo"], + updatable: false, + } + apex_key { + name: "myapex.key", + } + cc_binary { + name: "binfoo", + apex_available: ["myapex"], + } + cc_library { + name: "libfoo", + apex_available: ["myapex"], + } + android_app { + name: "appfoo", + sdk_version: "current", + apex_available: ["myapex"], + } + `, filesystem.PrepareForTestWithFilesystemBuildComponents) + + partition := result.ModuleForTests("myfilesystem", "android_common") + fileList := android.ContentFromFileRuleForTests(t, result, partition.Output("fileList")) + android.AssertDeepEquals(t, "filesystem with apex", "apex/myapex.apex\n", fileList) +} diff --git a/apex/builder.go b/apex/builder.go index 371d7d527..8bfb210fb 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -621,7 +621,8 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) { } } else { if installSymbolFiles { - installedPath = ctx.InstallFile(apexDir.Join(ctx, fi.installDir), fi.stem(), fi.builtFile) + // store installedPath. symlinks might be created if required. + installedPath = apexDir.Join(ctx, fi.installDir, fi.stem()) } } |