Support SourceFileProducer in android.OutputFilesForModule
Add support to android.OutputFilesForModule to get paths from a SourceFileProducer as well as an OutputFileProducer. Bug: 173977903 Test: m checkbuild Change-Id: I4b2ca2837342ddbb4210bee8f549a636d8b8b049
This commit is contained in:
@@ -2578,6 +2578,15 @@ func outputFilesForModule(ctx PathContext, module blueprint.Module, tag string)
|
|||||||
return nil, fmt.Errorf("failed to get output files from module %q", pathContextName(ctx, module))
|
return nil, fmt.Errorf("failed to get output files from module %q", pathContextName(ctx, module))
|
||||||
}
|
}
|
||||||
return paths, nil
|
return paths, nil
|
||||||
|
} else if sourceFileProducer, ok := module.(SourceFileProducer); ok {
|
||||||
|
if tag != "" {
|
||||||
|
return nil, fmt.Errorf("module %q is a SourceFileProducer, not an OutputFileProducer, and so does not support tag %q", pathContextName(ctx, module), tag)
|
||||||
|
}
|
||||||
|
paths := sourceFileProducer.Srcs()
|
||||||
|
if len(paths) == 0 {
|
||||||
|
return nil, fmt.Errorf("failed to get output files from module %q", pathContextName(ctx, module))
|
||||||
|
}
|
||||||
|
return paths, nil
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("module %q is not an OutputFileProducer", pathContextName(ctx, module))
|
return nil, fmt.Errorf("module %q is not an OutputFileProducer", pathContextName(ctx, module))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user