From abdb293492018ba8fe29a94817e089fc8174fa56 Mon Sep 17 00:00:00 2001 From: mrziwang Date: Tue, 18 Jun 2024 12:43:41 -0700 Subject: Update outputFilesForModuleFromProvider This CL includes following changes: 1. Added the ability to differentiate the cases that module never sets OutputFilesProvider and that module sets the provider with a nil value. 2. Updated GenerateTaggedDistFiles to use outputFilesForModuleFromProvider. 3. Updated on cc module to use OutputFilesProvider. Test: CI Bug: 339477385 Change-Id: Ib5663a947315f6a90a81b7f073cf8dd22fbb1e05 --- android/testing.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'android/testing.go') diff --git a/android/testing.go b/android/testing.go index 8dd467dce..18fd3b31c 100644 --- a/android/testing.go +++ b/android/testing.go @@ -1025,9 +1025,12 @@ func (m TestingModule) VariablesForTestsRelativeToTop() map[string]string { // otherwise returns the result of calling Paths.RelativeToTop // on the returned Paths. func (m TestingModule) OutputFiles(t *testing.T, tag string) Paths { - // TODO: add non-empty-string tag case and remove OutputFileProducer part - if tag == "" && m.module.base().outputFiles.DefaultOutputFiles != nil { - return m.module.base().outputFiles.DefaultOutputFiles.RelativeToTop() + // TODO: remove OutputFileProducer part + outputFiles := m.Module().base().outputFiles + if tag == "" && outputFiles.DefaultOutputFiles != nil { + return outputFiles.DefaultOutputFiles.RelativeToTop() + } else if taggedOutputFiles, hasTag := outputFiles.TaggedOutputFiles[tag]; hasTag { + return taggedOutputFiles } producer, ok := m.module.(OutputFileProducer) -- cgit v1.2.3-59-g8ed1b