Correct lint error when it cannot find api_versions_* module

Also, fixes the error when it cannot find a module containing the
`annotations.zip` file.

Bug: 336993217
Test: change `apiVersionsModule` setting in `lint.go` to refer to
      a non-existent module and then run `m nothing` to see the
      error message correctly lists the module name.
Change-Id: I84a9e241d1c3bedebc26e119bd4b9861664c43c1
This commit is contained in:
Paul Duffin 2024-05-02 12:44:20 +01:00
parent 364740b4a4
commit 375acd8def

View file

@ -612,7 +612,7 @@ func (l *lintSingleton) copyLintDependencies(ctx android.SingletonContext) {
apiVersionsDb := findModuleOrErr(ctx, files.apiVersionsModule)
if apiVersionsDb == nil {
if !ctx.Config().AllowMissingDependencies() {
ctx.Errorf("lint: missing module api_versions_public")
ctx.Errorf("lint: missing module %s", files.apiVersionsModule)
}
return
}
@ -620,7 +620,7 @@ func (l *lintSingleton) copyLintDependencies(ctx android.SingletonContext) {
sdkAnnotations := findModuleOrErr(ctx, files.annotationsModule)
if sdkAnnotations == nil {
if !ctx.Config().AllowMissingDependencies() {
ctx.Errorf("lint: missing module sdk-annotations.zip")
ctx.Errorf("lint: missing module %s", files.annotationsModule)
}
return
}