diff options
author | 2025-03-06 19:10:16 -0800 | |
---|---|---|
committer | 2025-03-06 19:10:16 -0800 | |
commit | aef03537446a674206379c9d91248bd47dee6bb2 (patch) | |
tree | 58424db5ca157cbf8090b6777ed1fedebca8bbc6 /filesystem/android_device.go | |
parent | 4001c291d82003e15e6c443fc781cfece35fa0a2 (diff) | |
parent | 7b8455f5c23b600b117cde216280b584ca6b9a1d (diff) |
Merge "Add support for SBOM generation in soong-only builds" into main
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r-- | filesystem/android_device.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go index 17209ed4a..04eaf840e 100644 --- a/filesystem/android_device.go +++ b/filesystem/android_device.go @@ -19,6 +19,7 @@ import ( "fmt" "path/filepath" "slices" + "sort" "strings" "sync/atomic" @@ -280,6 +281,31 @@ func (a *androidDevice) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.setVbmetaPhonyTargets(ctx) a.distFiles(ctx) + + android.SetProvider(ctx, android.AndroidDeviceInfoProvider, android.AndroidDeviceInfo{ + Main_device: android.Bool(a.deviceProps.Main_device), + }) + + if proptools.String(a.partitionProps.Super_partition_name) != "" { + buildComplianceMetadata(ctx, superPartitionDepTag, filesystemDepTag) + } else { + buildComplianceMetadata(ctx, filesystemDepTag) + } +} + +func buildComplianceMetadata(ctx android.ModuleContext, tags ...blueprint.DependencyTag) { + filesContained := make([]string, 0) + for _, tag := range tags { + ctx.VisitDirectDepsProxyWithTag(tag, func(m android.ModuleProxy) { + if complianceMetadataInfo, ok := android.OtherModuleProvider(ctx, m, android.ComplianceMetadataProvider); ok { + filesContained = append(filesContained, complianceMetadataInfo.GetFilesContained()...) + } + }) + } + sort.Strings(filesContained) + + complianceMetadataInfo := ctx.ComplianceMetadataInfo() + complianceMetadataInfo.SetFilesContained(filesContained) } // Returns a list of modules that are installed, which are collected from the dependency |