Convert computeInstallDeps and buildLicenseMetadata to use ModuleProxy.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I63da95a938404b9d56cea65143479a961b82e051
diff --git a/android/license_metadata.go b/android/license_metadata.go
index 3df36e6..d15dfa8 100644
--- a/android/license_metadata.go
+++ b/android/license_metadata.go
@@ -15,11 +15,11 @@
package android
import (
- "github.com/google/blueprint/depset"
"sort"
"strings"
"github.com/google/blueprint"
+ "github.com/google/blueprint/depset"
"github.com/google/blueprint/proptools"
)
@@ -64,8 +64,8 @@
var allDepOutputFiles Paths
var allDepMetadataDepSets []depset.DepSet[Path]
- ctx.VisitDirectDeps(func(dep Module) {
- if !dep.Enabled(ctx) {
+ ctx.VisitDirectDepsProxy(func(dep ModuleProxy) {
+ if !OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoKey).Enabled {
return
}
@@ -81,7 +81,7 @@
if info, ok := OtherModuleProvider(ctx, dep, LicenseMetadataProvider); ok {
allDepMetadataFiles = append(allDepMetadataFiles, info.LicenseMetadataPath)
- if isContainer || isInstallDepNeeded(dep, ctx.OtherModuleDependencyTag(dep)) {
+ if isContainer || isInstallDepNeeded(ctx, dep) {
allDepMetadataDepSets = append(allDepMetadataDepSets, info.LicenseMetadataDepSet)
}