diff options
author | 2025-03-07 01:30:43 +0000 | |
---|---|---|
committer | 2025-03-07 02:04:03 +0000 | |
commit | dd49f4112093d8b35b3083a600b4ee54e3ec157e (patch) | |
tree | 7e1cb95be4909ca1bae69bda95bea4a4120bad38 /filesystem/android_device.go | |
parent | 52e53c643ee30aab988b394a16413aa01218a371 (diff) |
Propagate installed files of Include_files_of dependencies
Some partitions (e.g. recovery) are transitive dependencies of
android_device module, and are not directly listed as partitions. This
change allows the installed files of `Include_files_of` partitions to be
propagated to the rdep filesystem module, so that it can reach the
android_device module and be disted.
Test: m nothing dist --soong-only && aninja -t query _dist_droidcore-unbundled
Bug: 395162005
Change-Id: Icc0e902d5d42b925d04470b60b5e62daac4c4a17
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r-- | filesystem/android_device.go | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go index 86771d13a..a26ed432e 100644 --- a/filesystem/android_device.go +++ b/filesystem/android_device.go @@ -319,22 +319,32 @@ func insertBeforeExtension(file, insertion string) string { return strings.TrimSuffix(file, ext) + insertion + ext } +func (a *androidDevice) distInstalledFiles(ctx android.ModuleContext) { + distInstalledFilesJsonAndTxt := func(installedFiles InstalledFilesStruct) { + if installedFiles.Json != nil { + ctx.DistForGoal("droidcore-unbundled", installedFiles.Json) + } + if installedFiles.Txt != nil { + ctx.DistForGoal("droidcore-unbundled", installedFiles.Txt) + } + } + + fsInfoMap := a.getFsInfos(ctx) + for _, partition := range android.SortedKeys(fsInfoMap) { + // installed-files-*{.txt | .json} is not disted for userdata partition + if partition == "userdata" { + continue + } + fsInfo := fsInfoMap[partition] + for _, installedFiles := range fsInfo.InstalledFilesDepSet.ToList() { + distInstalledFilesJsonAndTxt(installedFiles) + } + } +} + func (a *androidDevice) distFiles(ctx android.ModuleContext) { if !ctx.Config().KatiEnabled() && proptools.Bool(a.deviceProps.Main_device) { - fsInfoMap := a.getFsInfos(ctx) - for _, partition := range android.SortedKeys(fsInfoMap) { - // installed-files-*{.txt | .json} is not disted for userdata partition - if partition == "userdata" { - continue - } - fsInfo := fsInfoMap[partition] - if fsInfo.InstalledFiles.Json != nil { - ctx.DistForGoal("droidcore-unbundled", fsInfo.InstalledFiles.Json) - } - if fsInfo.InstalledFiles.Txt != nil { - ctx.DistForGoal("droidcore-unbundled", fsInfo.InstalledFiles.Txt) - } - } + a.distInstalledFiles(ctx) namePrefix := "" if ctx.Config().HasDeviceProduct() { |