Merge "Drop INTERNAL_PLATFORM_MISSING_USES_LIBRARIES."

This commit is contained in:
Jiakai Zhang 2023-06-02 14:59:10 +00:00 committed by Gerrit Code Review
commit f508c252bb
4 changed files with 9 additions and 12 deletions

View file

@ -1710,10 +1710,6 @@ func (c *config) ProductPrivateSepolicyDirs() []string {
return c.productVariables.ProductPrivateSepolicyDirs
}
func (c *config) MissingUsesLibraries() []string {
return c.productVariables.MissingUsesLibraries
}
func (c *config) TargetMultitreeUpdateMeta() bool {
return c.productVariables.MultitreeUpdateMeta
}

View file

@ -420,8 +420,6 @@ type productVariables struct {
TargetFSConfigGen []string `json:",omitempty"`
MissingUsesLibraries []string `json:",omitempty"`
EnforceProductPartitionInterface *bool `json:",omitempty"`
EnforceInterPartitionJavaSdkLibrary *bool `json:",omitempty"`

View file

@ -18,6 +18,7 @@ package java
// related module types, including their override variants.
import (
"fmt"
"path/filepath"
"strings"
@ -1391,10 +1392,15 @@ func (u *usesLibrary) deps(ctx android.BottomUpMutatorContext, addCompatDeps boo
}
}
// presentOptionalUsesLibs returns optional_uses_libs after filtering out MissingUsesLibraries, which don't exist in the
// build.
// presentOptionalUsesLibs returns optional_uses_libs after filtering out libraries that don't exist in the source tree.
func (u *usesLibrary) presentOptionalUsesLibs(ctx android.BaseModuleContext) []string {
optionalUsesLibs, _ := android.FilterList(u.usesLibraryProperties.Optional_uses_libs, ctx.Config().MissingUsesLibraries())
optionalUsesLibs := android.FilterListPred(u.usesLibraryProperties.Optional_uses_libs, func(s string) bool {
exists := ctx.OtherModuleExists(s)
if !exists {
fmt.Printf("Warning: Module '%s' depends on non-existing optional_uses_libs '%s'\n", ctx.ModuleName(), s)
}
return exists
})
return optionalUsesLibs
}

View file

@ -2644,9 +2644,6 @@ func TestUsesLibraries(t *testing.T) {
prepareForJavaTest,
PrepareForTestWithJavaSdkLibraryFiles,
FixtureWithLastReleaseApis("runtime-library", "foo", "quuz", "qux", "bar", "fred"),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.MissingUsesLibraries = []string{"baz"}
}),
).RunTestWithBp(t, bp)
app := result.ModuleForTests("app", "android_common")