Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f6ffc72 authored by Colin Cross's avatar Colin Cross
Browse files

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
parent bc139927
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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)
				}
			}