Stop java_sdk_library_import from depending on source modules

Previously, java_sdk_library_import added the dependencies on its child
components in the deps mutator after prebuilts without a matching
source module are renamed to the source module name. That meant that
the java_sdk_library_import has to use the source module name and ended
up depending on the source module unless it was preferred.

This change adds a new component deps mutator that runs before the
PrebuiltRenameMutator so that the java_sdk_library_import can add
dependencies onto the prebuilt modules. It also updates an affected
test.

Bug: 159902351
Test: m nothing
Change-Id: I3576c4873302743e51aff547ea1497bef6d748ac
This commit is contained in:
Paul Duffin
2020-06-26 20:17:02 +01:00
parent ecc495fd09
commit 44f1d8404b
6 changed files with 58 additions and 6 deletions

View File

@@ -228,6 +228,16 @@ type Module interface {
// For more information, see Module.GenerateBuildActions within Blueprint's module_ctx.go
GenerateAndroidBuildActions(ModuleContext)
// Add dependencies to the components of a module, i.e. modules that are created
// by the module and which are considered to be part of the creating module.
//
// This is called before prebuilts are renamed so as to allow a dependency to be
// added directly to a prebuilt child module instead of depending on a source module
// and relying on prebuilt processing to switch to the prebuilt module if preferred.
//
// A dependency on a prebuilt must include the "prebuilt_" prefix.
ComponentDepsMutator(ctx BottomUpMutatorContext)
DepsMutator(BottomUpMutatorContext)
base() *ModuleBase
@@ -769,6 +779,8 @@ type ModuleBase struct {
prefer32 func(ctx BaseModuleContext, base *ModuleBase, class OsClass) bool
}
func (m *ModuleBase) ComponentDepsMutator(BottomUpMutatorContext) {}
func (m *ModuleBase) DepsMutator(BottomUpMutatorContext) {}
func (m *ModuleBase) AddProperties(props ...interface{}) {