From 4f65a03d30a4f89ca3eeca70ada21cd79c43b220 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Thu, 1 Jun 2023 15:16:58 +0100 Subject: Drop INTERNAL_PLATFORM_MISSING_USES_LIBRARIES. Bug: 282877248 Test: Presubmit build tests. Change-Id: Idd69433f308f5f47973ff0d5340a2399a27cb32c --- java/app.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'java/app.go') diff --git a/java/app.go b/java/app.go index 561ce1d17..cdec1e121 100755 --- a/java/app.go +++ b/java/app.go @@ -18,6 +18,7 @@ package java // related module types, including their override variants. import ( + "fmt" "path/filepath" "strings" @@ -1390,10 +1391,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 } -- cgit v1.2.3-59-g8ed1b