Add dependencies for Metalava's implicit android.jar references
Metalava implicitly searches prebuilts/tools/common/api-versions/android-%/android.jar and prebuilts/sdk/%/public/android.jar when looking for --android-jar-patterns matches, and fails if it can't find a match for an API level between 1 and 28 in at least one pattern. Add android.jar files from the api_levels_annotations_dirs directories to try to satisfy these patterns. Bug: 153703940 Test: m docs Change-Id: I866850b33d9a5cd82cc5135bd8f9e9400ed65439
This commit is contained in:
parent
bc13992711
commit
5f6ffc72f7
1 changed files with 10 additions and 1 deletions
|
@ -360,7 +360,16 @@ func (d *Droidstubs) apiLevelsAnnotationsFlags(ctx android.ModuleContext, cmd *a
|
|||
ctx.VisitDirectDepsWithTag(metalavaAPILevelsAnnotationsDirTag, func(m android.Module) {
|
||||
if t, ok := m.(*ExportedDroiddocDir); ok {
|
||||
for _, dep := range t.deps {
|
||||
if strings.HasSuffix(dep.String(), filename) {
|
||||
if dep.Base() == filename {
|
||||
cmd.Implicit(dep)
|
||||
}
|
||||
if filename != "android.jar" && dep.Base() == "android.jar" {
|
||||
// Metalava implicitly searches these patterns:
|
||||
// prebuilts/tools/common/api-versions/android-%/android.jar
|
||||
// prebuilts/sdk/%/public/android.jar
|
||||
// Add android.jar files from the api_levels_annotations_dirs directories to try
|
||||
// to satisfy these patterns. If Metalava can't find a match for an API level
|
||||
// between 1 and 28 in at least one pattern it will fail.
|
||||
cmd.Implicit(dep)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue