Add a String() method to android.Module

Add a String() method to android.Module for use in debugging.  Store
the name and variations of the module as they are mutated.

Test: TestModuleString
Bug: 136473661
Change-Id: I74e393703dcfc96ed4e21ac4a4419a7858b59216
This commit is contained in:
Colin Cross
2019-07-01 15:32:45 -07:00
parent cb55e089f0
commit 9a36223d59
4 changed files with 157 additions and 4 deletions

View File

@@ -129,6 +129,8 @@ func registerLoadHookMutator(ctx RegisterMutatorsContext) {
func LoadHookMutator(ctx TopDownMutatorContext) {
if m, ok := ctx.Module().(Module); ok {
m.base().commonProperties.DebugName = ctx.ModuleName()
// Cast through *topDownMutatorContext because AppendProperties is implemented
// on *topDownMutatorContext but not exposed through TopDownMutatorContext
var loadHookCtx LoadHookContext = ctx.(*topDownMutatorContext)