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
diff --git a/android/module_context.go b/android/module_context.go
index 18adb30..bc08911 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -212,6 +212,10 @@
// 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 @@
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.
//