Use OutputFilesProvider on bpf

This changes makes bpf module type uses OutputFilesProvider,
instead of current OutputFileProducer for inter-module-
communication.

Test: CI
Bug: 339477385
Bug: 342406930
Change-Id: I85d1141e9f6583cc5427756107da99f56b0c7ea1
This commit is contained in:
mrziwang
2024-05-22 14:36:09 -07:00
parent 5f2be11396
commit e6c8581fbe
6 changed files with 88 additions and 32 deletions

View File

@@ -212,6 +212,10 @@ type ModuleContext interface {
// GenerateAndroidBuildActions. If it is called then the struct will be written out and included in
// the module-info.json generated by Make, and Make will not generate its own data for this module.
ModuleInfoJSON() *ModuleInfoJSON
// SetOutputFiles stores the outputFiles to outputFiles property, which is used
// to set the OutputFilesProvider later.
SetOutputFiles(outputFiles Paths, tag string)
}
type moduleContext struct {
@@ -707,6 +711,21 @@ func (m *moduleContext) ModuleInfoJSON() *ModuleInfoJSON {
return moduleInfoJSON
}
func (m *moduleContext) SetOutputFiles(outputFiles Paths, tag string) {
if tag == "" {
if len(m.module.base().outputFiles.DefaultOutputFiles) > 0 {
m.ModuleErrorf("Module %s default OutputFiles cannot be overwritten", m.ModuleName())
}
m.module.base().outputFiles.DefaultOutputFiles = outputFiles
} else {
if _, exists := m.module.base().outputFiles.TaggedOutputFiles[tag]; exists {
m.ModuleErrorf("Module %s OutputFiles at tag %s cannot be overwritten", m.ModuleName(), tag)
} else {
m.module.base().outputFiles.TaggedOutputFiles[tag] = outputFiles
}
}
}
// Returns a list of paths expanded from globs and modules referenced using ":module" syntax. The property must
// be tagged with `android:"path" to support automatic source module dependency resolution.
//