From d9ccb6a2cbbf76618c4ed5c78b1a1efc5736e598 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 7 Mar 2022 18:38:34 -0800 Subject: [PATCH] Skip install rules for apexes with installable: false When an apex sets installable: false call SkipInstall to prevent creating the install rules, and don't report the install rules to Make. Fixes: 221261079 Test: m checkbuild Change-Id: If94759b16f79ee10ddcf8ee89603ca9e822b74f5 --- apex/androidmk.go | 6 ++++-- apex/builder.go | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apex/androidmk.go b/apex/androidmk.go index 8785ca0f3..059b4d76c 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -373,8 +373,10 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { } fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", name+stemSuffix) fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !a.installable()) - fmt.Fprintln(w, "LOCAL_SOONG_INSTALLED_MODULE :=", a.installedFile.String()) - fmt.Fprintln(w, "LOCAL_SOONG_INSTALL_PAIRS :=", a.outputFile.String()+":"+a.installedFile.String()) + if a.installable() { + fmt.Fprintln(w, "LOCAL_SOONG_INSTALLED_MODULE :=", a.installedFile.String()) + fmt.Fprintln(w, "LOCAL_SOONG_INSTALL_PAIRS :=", a.outputFile.String()+":"+a.installedFile.String()) + } // Because apex writes .mk with Custom(), we need to write manually some common properties // which are available via data.Entries diff --git a/apex/builder.go b/apex/builder.go index 183c21562..8c5f99bf5 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -856,6 +856,10 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { installSuffix = imageCapexSuffix } + if !a.installable() { + a.SkipInstall() + } + // Install to $OUT/soong/{target,host}/.../apex. a.installedFile = ctx.InstallFile(a.installDir, a.Name()+installSuffix, a.outputFile, a.compatSymlinks.Paths()...)