summaryrefslogtreecommitdiff
path: root/android/module_context.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2024-08-29 17:07:05 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-08-29 17:07:05 +0000
commit11d8b6e8d3608f81c416fd15e98bad4cb86e46bc (patch)
tree7c4bf9d5eeb502d94897500fe1dd33016bfcca8c /android/module_context.go
parent88a8daf8cae89783450b349d2a4217e6ed0c4a94 (diff)
parent9a99313ac67becf1d5d7ddbc5440af934d8d1710 (diff)
Merge "Remove containersInfo, complianceMetadataInfo and aconfigFilePaths from ModuleBase." into main
Diffstat (limited to 'android/module_context.go')
-rw-r--r--android/module_context.go39
1 files changed, 33 insertions, 6 deletions
diff --git a/android/module_context.go b/android/module_context.go
index 5322240e5..c677f9482 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -226,6 +226,12 @@ type ModuleContext interface {
// which usually happens in GenerateAndroidBuildActions() of a module type.
// See android.ModuleBase.complianceMetadataInfo
ComplianceMetadataInfo() *ComplianceMetadataInfo
+
+ // Get the information about the containers this module belongs to.
+ getContainersInfo() ContainersInfo
+ setContainersInfo(info ContainersInfo)
+
+ setAconfigPaths(paths Paths)
}
type moduleContext struct {
@@ -270,6 +276,17 @@ type moduleContext struct {
// moduleInfoJSON can be filled out by GenerateAndroidBuildActions to write a JSON file that will
// be included in the final module-info.json produced by Make.
moduleInfoJSON *ModuleInfoJSON
+
+ // containersInfo stores the information about the containers and the information of the
+ // apexes the module belongs to.
+ containersInfo ContainersInfo
+
+ // Merged Aconfig files for all transitive deps.
+ aconfigFilePaths Paths
+
+ // complianceMetadataInfo is for different module types to dump metadata.
+ // See android.ModuleContext interface.
+ complianceMetadataInfo *ComplianceMetadataInfo
}
var _ ModuleContext = &moduleContext{}
@@ -517,7 +534,11 @@ func (m *moduleContext) PackageFile(installPath InstallPath, name string, srcPat
}
func (m *moduleContext) getAconfigPaths() *Paths {
- return &m.module.base().aconfigFilePaths
+ return &m.aconfigFilePaths
+}
+
+func (m *moduleContext) setAconfigPaths(paths Paths) {
+ m.aconfigFilePaths = paths
}
func (m *moduleContext) packageFile(fullInstallPath InstallPath, srcPath Path, executable bool) PackagingSpec {
@@ -768,12 +789,10 @@ func (m *moduleContext) SetLicenseInstallMap(installMap []string) {
}
func (m *moduleContext) ComplianceMetadataInfo() *ComplianceMetadataInfo {
- if complianceMetadataInfo := m.module.base().complianceMetadataInfo; complianceMetadataInfo != nil {
- return complianceMetadataInfo
+ if m.complianceMetadataInfo == nil {
+ m.complianceMetadataInfo = NewComplianceMetadataInfo()
}
- complianceMetadataInfo := NewComplianceMetadataInfo()
- m.module.base().complianceMetadataInfo = complianceMetadataInfo
- return complianceMetadataInfo
+ return m.complianceMetadataInfo
}
// Returns a list of paths expanded from globs and modules referenced using ":module" syntax. The property must
@@ -813,3 +832,11 @@ func (m *moduleContext) HostRequiredModuleNames() []string {
func (m *moduleContext) TargetRequiredModuleNames() []string {
return m.module.TargetRequiredModuleNames()
}
+
+func (m *moduleContext) getContainersInfo() ContainersInfo {
+ return m.containersInfo
+}
+
+func (m *moduleContext) setContainersInfo(info ContainersInfo) {
+ m.containersInfo = info
+}