diff options
author | 2025-02-25 12:55:33 -0800 | |
---|---|---|
committer | 2025-02-25 12:55:33 -0800 | |
commit | d272a622e908736b01bf731dc653aadc47c64971 (patch) | |
tree | 35ddbe0592ca3f0a703c2d39b8747729590e809d /java/lint.go | |
parent | 89dab88cc55d9ab0ff85d0a30780ad182cdaf214 (diff) | |
parent | 2a815b6d8ea8f29b54f780b1219c28b0c8c977aa (diff) |
Merge "Convert the following singletons to use ModuleProxy:" into main
Diffstat (limited to 'java/lint.go')
-rw-r--r-- | java/lint.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/java/lint.go b/java/lint.go index 66f7f8549..c31dfd005 100644 --- a/java/lint.go +++ b/java/lint.go @@ -595,12 +595,12 @@ func (l *lintSingleton) GenerateBuildActions(ctx android.SingletonContext) { l.copyLintDependencies(ctx) } -func findModuleOrErr(ctx android.SingletonContext, moduleName string) android.Module { - var res android.Module - ctx.VisitAllModules(func(m android.Module) { +func findModuleOrErr(ctx android.SingletonContext, moduleName string) *android.ModuleProxy { + var res *android.ModuleProxy + ctx.VisitAllModuleProxies(func(m android.ModuleProxy) { if ctx.ModuleName(m) == moduleName { if res == nil { - res = m + res = &m } else { ctx.Errorf("lint: multiple %s modules found: %s and %s", moduleName, ctx.ModuleSubDir(m), ctx.ModuleSubDir(res)) @@ -635,13 +635,13 @@ func (l *lintSingleton) copyLintDependencies(ctx android.SingletonContext) { ctx.Build(pctx, android.BuildParams{ Rule: android.CpIfChanged, - Input: android.OutputFileForModule(ctx, sdkAnnotations, ""), + Input: android.OutputFileForModule(ctx, *sdkAnnotations, ""), Output: copiedLintDatabaseFilesPath(ctx, files.annotationCopiedName), }) ctx.Build(pctx, android.BuildParams{ Rule: android.CpIfChanged, - Input: android.OutputFileForModule(ctx, apiVersionsDb, ".api_versions.xml"), + Input: android.OutputFileForModule(ctx, *apiVersionsDb, ".api_versions.xml"), Output: copiedLintDatabaseFilesPath(ctx, files.apiVersionsCopiedName), }) } @@ -658,12 +658,13 @@ func (l *lintSingleton) generateLintReportZips(ctx android.SingletonContext) { var outputs []*LintInfo var dirs []string - ctx.VisitAllModules(func(m android.Module) { - if ctx.Config().KatiEnabled() && !m.ExportedToMake() { + ctx.VisitAllModuleProxies(func(m android.ModuleProxy) { + commonInfo, _ := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoKey) + if ctx.Config().KatiEnabled() && !commonInfo.ExportedToMake { return } - if apex, ok := m.(android.ApexModule); ok && apex.NotAvailableForPlatform() { + if commonInfo.IsApexModule && commonInfo.NotAvailableForPlatform { apexInfo, _ := android.OtherModuleProvider(ctx, m, android.ApexInfoProvider) if apexInfo.IsForPlatform() { // There are stray platform variants of modules in apexes that are not available for |