summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2024-12-03 19:54:05 +0000
committer Yu Liu <yudiliu@google.com> 2024-12-03 19:55:25 +0000
commit63bdf6337384ea49838482d4cf879ac9a56f2862 (patch)
treeb8f1e2b2adad4e829ab0fa66b4dbff6f6c4b37de /apex/apex.go
parent44c5548d05722cd1733796c3db7215968bd183a3 (diff)
Change checkJavaStableSdkVersion to use ModuleProxy.
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I221f4ea7479d512d49cfb40a8cb06bba62ec2c7a
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 72a045525..1a598e507 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2647,16 +2647,12 @@ func (a *apexBundle) checkClasspathFragments(ctx android.ModuleContext) {
func (a *apexBundle) checkJavaStableSdkVersion(ctx android.ModuleContext) {
// Visit direct deps only. As long as we guarantee top-level deps are using stable SDKs,
// java's checkLinkType guarantees correct usage for transitive deps
- ctx.VisitDirectDeps(func(module android.Module) {
+ ctx.VisitDirectDepsProxy(func(module android.ModuleProxy) {
tag := ctx.OtherModuleDependencyTag(module)
switch tag {
case javaLibTag, androidAppTag:
- if m, ok := module.(interface {
- CheckStableSdkVersion(ctx android.BaseModuleContext) error
- }); ok {
- if err := m.CheckStableSdkVersion(ctx); err != nil {
- ctx.ModuleErrorf("cannot depend on \"%v\": %v", ctx.OtherModuleName(module), err)
- }
+ if err := java.CheckStableSdkVersion(ctx, module); err != nil {
+ ctx.ModuleErrorf("cannot depend on \"%v\": %v", ctx.OtherModuleName(module), err)
}
}
})