Only output make targets for uninstallable static libs in the APEX

unavailable-to-platform case.

This removes the special case added in https://r.android.com/1274763
from SkipInstall(), so that it doesn't cause conflicting AndroidMk
entries when a cc_prebuilt_library_static module has prefer:true and
the corresponding source module exists.

Test: `m` in a tree with a snapshot created from art-module-sdk where
  the libartimagevalues module has prefer:true
Bug: 151303681
Change-Id: I651ae325753b707296892adb4cae80daaddb6af2
This commit is contained in:
Martin Stjernholm
2020-08-06 22:34:42 +01:00
parent 1f109cd376
commit 9e9bb7f223
7 changed files with 28 additions and 23 deletions

View File

@@ -296,7 +296,10 @@ func (m *ApexModuleBase) CreateApexVariations(mctx BottomUpMutatorContext) []Mod
for i, mod := range modules {
platformVariation := i == 0
if platformVariation && !mctx.Host() && !mod.(ApexModule).AvailableFor(AvailableToPlatform) {
mod.SkipInstall()
// Do not install the module for platform, but still allow it to output
// uninstallable AndroidMk entries in certain cases when they have
// side effects.
mod.MakeUninstallable()
}
if !platformVariation {
mod.(ApexModule).apexModuleBase().ApexProperties.Info = m.apexVariations[i-1]