From 4295359c12943257c44e497e545f058dd20a93ee Mon Sep 17 00:00:00 2001 From: mrziwang Date: Thu, 20 Jun 2024 09:53:33 -0700 Subject: [PATCH] Allow module gets its own output files using non-empty-string tag Test: CI Bug: 339477385 Change-Id: I332c377ad59d9355cb44ee18b85a56e37580e7b6 --- android/module.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/module.go b/android/module.go index b43815063..a75f03f6d 100644 --- a/android/module.go +++ b/android/module.go @@ -2524,8 +2524,7 @@ func outputFilesForModule(ctx PathContext, module blueprint.Module, tag string) // *inter-module-communication*. // If mctx module is the same as the param module the output files are obtained // from outputFiles property of module base, to avoid both setting and -// reading OutputFilesProvider before GenerateBuildActions is finished. Also -// only empty-string-tag is supported in this case. +// reading OutputFilesProvider before GenerateBuildActions is finished. // If a module doesn't have the OutputFilesProvider, nil is returned. func outputFilesForModuleFromProvider(ctx PathContext, module blueprint.Module, tag string) (Paths, error) { // TODO: support OutputFilesProvider for singletons @@ -2546,6 +2545,8 @@ func outputFilesForModuleFromProvider(ctx PathContext, module blueprint.Module, } else { if tag == "" { return mctx.Module().base().outputFiles.DefaultOutputFiles, nil + } else if taggedOutputFiles, hasTag := mctx.Module().base().outputFiles.TaggedOutputFiles[tag]; hasTag { + return taggedOutputFiles, nil } else { return nil, fmt.Errorf("unsupported tag %q for module getting its own output files", tag) }