Remove installFilesDepSet, packagingSpecsDepSet and licenseInstallMap
from ModuleBase.
The old packagingSpecsDepSet field is kept temporarily to bypass an
auto-merge issue, and will be removed in next change.
Bug: 358425833
Test: CI
Change-Id: I28b4933459c33224f756cc306cabc8088f9be862
diff --git a/android/module.go b/android/module.go
index e74af83..9e882ec 100644
--- a/android/module.go
+++ b/android/module.go
@@ -836,7 +836,6 @@
primaryLicensesProperty applicableLicensesProperty
noAddressSanitizer bool
- installFilesDepSet *DepSet[InstallPath]
packagingSpecsDepSet *DepSet[PackagingSpec]
// katiInitRcInstalls and katiVintfInstalls track the install rules created by Soong that are
// allowed to have duplicates across modules and variants.
@@ -864,10 +863,6 @@
// Merged Aconfig files for all transitive deps.
aconfigFilePaths Paths
- // set of dependency module:location mappings used to populate the license metadata for
- // apex containers.
- licenseInstallMap []string
-
// The path to the generated license metadata file for the module.
licenseMetadataFile WritablePath
@@ -1454,12 +1449,13 @@
if isInstallDepNeeded(dep, ctx.OtherModuleDependencyTag(dep)) {
// Installation is still handled by Make, so anything hidden from Make is not
// installable.
+ info := OtherModuleProviderOrDefault(ctx, dep, InstallFilesProvider)
if !dep.IsHideFromMake() && !dep.IsSkipInstall() {
- installDeps = append(installDeps, dep.base().installFilesDepSet)
+ installDeps = append(installDeps, info.TransitiveInstallFiles)
}
// Add packaging deps even when the dependency is not installed so that uninstallable
// modules can still be packaged. Often the package will be installed instead.
- packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
+ packagingSpecs = append(packagingSpecs, info.TransitivePackagingSpecs)
}
})
@@ -1606,12 +1602,6 @@
return m.base().commonProperties.Compile_multilib
}
-// SetLicenseInstallMap stores the set of dependency module:location mappings for files in an
-// apex container for use when generation the license metadata file.
-func (m *ModuleBase) SetLicenseInstallMap(installMap []string) {
- m.licenseInstallMap = append(m.licenseInstallMap, installMap...)
-}
-
func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) {
var allInstalledFiles InstallPaths
var allCheckbuildFiles Paths
@@ -1781,9 +1771,12 @@
KatiInstalls katiInstalls
KatiSymlinks katiInstalls
TestData []DataPath
+ // This was private before, make it private again once we have better solution.
+ TransitiveInstallFiles *DepSet[InstallPath]
+ TransitivePackagingSpecs *DepSet[PackagingSpec]
}
-var FinalModuleBuildTargetsProvider = blueprint.NewProvider[FinalModuleBuildTargetsInfo]()
+var InstallFilesProvider = blueprint.NewProvider[InstallFilesInfo]()
type FinalModuleBuildTargetsInfo struct {
// Used by buildTargetSingleton to create checkbuild and per-directory build targets
@@ -1793,7 +1786,7 @@
BlueprintDir string
}
-var InstallFilesProvider = blueprint.NewProvider[InstallFilesInfo]()
+var FinalModuleBuildTargetsProvider = blueprint.NewProvider[FinalModuleBuildTargetsInfo]()
func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) {
ctx := &moduleContext{
@@ -1809,10 +1802,10 @@
m.licenseMetadataFile = PathForModuleOut(ctx, "meta_lic")
dependencyInstallFiles, dependencyPackagingSpecs := m.computeInstallDeps(ctx)
- // set m.installFilesDepSet to only the transitive dependencies to be used as the dependencies
+ // set the TransitiveInstallFiles to only the transitive dependencies to be used as the dependencies
// of installed files of this module. It will be replaced by a depset including the installed
// files of this module at the end for use by modules that depend on this one.
- m.installFilesDepSet = NewDepSet[InstallPath](TOPOLOGICAL, nil, dependencyInstallFiles)
+ ctx.TransitiveInstallFiles = NewDepSet[InstallPath](TOPOLOGICAL, nil, dependencyInstallFiles)
// Temporarily continue to call blueprintCtx.GetMissingDependencies() to maintain the previous behavior of never
// reporting missing dependency errors in Blueprint when AllowMissingDependencies == true.
@@ -1856,6 +1849,8 @@
checkDistProperties(ctx, fmt.Sprintf("dists[%d]", i), &m.distProperties.Dists[i])
}
+ var installFiles InstallFilesInfo
+
if m.Enabled(ctx) {
// ensure all direct android.Module deps are enabled
ctx.VisitDirectDepsBlueprint(func(bm blueprint.Module) {
@@ -1977,14 +1972,12 @@
return
}
- SetProvider(ctx, InstallFilesProvider, InstallFilesInfo{
- InstallFiles: ctx.installFiles,
- CheckbuildFiles: ctx.checkbuildFiles,
- PackagingSpecs: ctx.packagingSpecs,
- KatiInstalls: ctx.katiInstalls,
- KatiSymlinks: ctx.katiSymlinks,
- TestData: ctx.testData,
- })
+ installFiles.InstallFiles = ctx.installFiles
+ installFiles.CheckbuildFiles = ctx.checkbuildFiles
+ installFiles.PackagingSpecs = ctx.packagingSpecs
+ installFiles.KatiInstalls = ctx.katiInstalls
+ installFiles.KatiSymlinks = ctx.katiSymlinks
+ installFiles.TestData = ctx.testData
} else if ctx.Config().AllowMissingDependencies() {
// If the module is not enabled it will not create any build rules, nothing will call
// ctx.GetMissingDependencies(), and blueprint will consider the missing dependencies to be unhandled
@@ -2000,9 +1993,12 @@
}
}
- m.installFilesDepSet = NewDepSet[InstallPath](TOPOLOGICAL, ctx.installFiles, dependencyInstallFiles)
+ ctx.TransitiveInstallFiles = NewDepSet[InstallPath](TOPOLOGICAL, ctx.installFiles, dependencyInstallFiles)
+ installFiles.TransitiveInstallFiles = ctx.TransitiveInstallFiles
m.packagingSpecsDepSet = NewDepSet[PackagingSpec](TOPOLOGICAL, ctx.packagingSpecs, dependencyPackagingSpecs)
+ installFiles.TransitivePackagingSpecs = m.packagingSpecsDepSet
+ SetProvider(ctx, InstallFilesProvider, installFiles)
buildLicenseMetadata(ctx, m.licenseMetadataFile)
if m.moduleInfoJSON != nil {