diff options
Diffstat (limited to 'apex/apex.go')
| -rw-r--r-- | apex/apex.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apex/apex.go b/apex/apex.go index dd1c0b52e..77ebf2624 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -2767,10 +2767,21 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) { if to.AvailableFor(apexName) || baselineApexAvailable(apexName, toName) { return true } + + // Let's give some hint for apex_available + hint := fmt.Sprintf("%q", apexName) + + if strings.HasPrefix(apexName, "com.") && !strings.HasPrefix(apexName, "com.android.") && strings.Count(apexName, ".") >= 2 { + // In case of a partner APEX, prefix format might be an option. + components := strings.Split(apexName, ".") + components[len(components)-1] = "*" + hint += fmt.Sprintf(" or %q", strings.Join(components, ".")) + } + ctx.ModuleErrorf("%q requires %q that doesn't list the APEX under 'apex_available'."+ "\n\nDependency path:%s\n\n"+ - "Consider adding %q to 'apex_available' property of %q", - fromName, toName, ctx.GetPathString(true), apexName, toName) + "Consider adding %s to 'apex_available' property of %q", + fromName, toName, ctx.GetPathString(true), hint, toName) // Visit this module's dependencies to check and report any issues with their availability. return true }) |