Convert install and checkContainerViolations to use ModuleProxy.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I19ec2142415e88d7486ee58613065f8cdb6aca73
diff --git a/cc/cc.go b/cc/cc.go
index 21fd216..f9097e4 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -156,6 +156,8 @@
InRecovery bool
OnlyInRecovery bool
Installable *bool
+ // RelativeInstallPath returns the relative install path for this module.
+ RelativeInstallPath string
}
var LinkableInfoProvider = blueprint.NewProvider[*LinkableInfo]()
@@ -2322,6 +2324,7 @@
InRecovery: mod.InRecovery(),
OnlyInRecovery: mod.OnlyInRecovery(),
Installable: mod.Installable(),
+ RelativeInstallPath: mod.RelativeInstallPath(),
}
}
diff --git a/cc/test.go b/cc/test.go
index abec19a..abf9162 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -342,28 +342,28 @@
test.data = append(test.data, android.DataPath{SrcPath: dataSrcPath})
}
- ctx.VisitDirectDepsWithTag(dataLibDepTag, func(dep android.Module) {
+ ctx.VisitDirectDepsProxyWithTag(dataLibDepTag, func(dep android.ModuleProxy) {
depName := ctx.OtherModuleName(dep)
- linkableDep, ok := dep.(LinkableInterface)
+ linkableDep, ok := android.OtherModuleProvider(ctx, dep, LinkableInfoProvider)
if !ok {
ctx.ModuleErrorf("data_lib %q is not a LinkableInterface module", depName)
}
- if linkableDep.OutputFile().Valid() {
+ if linkableDep.OutputFile.Valid() {
test.data = append(test.data,
- android.DataPath{SrcPath: linkableDep.OutputFile().Path(),
- RelativeInstallPath: linkableDep.RelativeInstallPath()})
+ android.DataPath{SrcPath: linkableDep.OutputFile.Path(),
+ RelativeInstallPath: linkableDep.RelativeInstallPath})
}
})
- ctx.VisitDirectDepsWithTag(dataBinDepTag, func(dep android.Module) {
+ ctx.VisitDirectDepsProxyWithTag(dataBinDepTag, func(dep android.ModuleProxy) {
depName := ctx.OtherModuleName(dep)
- linkableDep, ok := dep.(LinkableInterface)
+ linkableDep, ok := android.OtherModuleProvider(ctx, dep, LinkableInfoProvider)
if !ok {
ctx.ModuleErrorf("data_bin %q is not a LinkableInterface module", depName)
}
- if linkableDep.OutputFile().Valid() {
+ if linkableDep.OutputFile.Valid() {
test.data = append(test.data,
- android.DataPath{SrcPath: linkableDep.OutputFile().Path(),
- RelativeInstallPath: linkableDep.RelativeInstallPath()})
+ android.DataPath{SrcPath: linkableDep.OutputFile.Path(),
+ RelativeInstallPath: linkableDep.RelativeInstallPath})
}
})