summaryrefslogtreecommitdiff
path: root/android/module_context.go
diff options
context:
space:
mode:
author mrziwang <mrziwang@google.com> 2024-05-22 14:36:09 -0700
committer mrziwang <mrziwang@google.com> 2024-06-04 22:09:13 -0700
commite6c8581fbef9ee7d9cd859b61ba07564ea1299c2 (patch)
tree9b286cf3f03bcc12c49f68e324ac338976b8342c /android/module_context.go
parent5f2be11396ae371f6b7e2a5700ec9c2b41dc0826 (diff)
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
Diffstat (limited to 'android/module_context.go')
-rw-r--r--android/module_context.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/android/module_context.go b/android/module_context.go
index 18adb3002..bc089114f 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -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.
//