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

Commit 03b733c9 authored by Nan Zhang's avatar Nan Zhang
Browse files

Use Metalava based android.jar for SDK

Define LOCAL_DROIDDOC_ANNOTATIONS_ZIP to export zip file.

Test: m out/target/common/obj/PACKAGING/metalava-api-stubs-docs_annotations.zip
Bug: b/78245848
Change-Id: I66ca2a50adc095cc8a8a1a10620427a91480a9bc
parent e029b28d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -304,6 +304,9 @@ func (ddoc *Droiddoc) AndroidMk() android.AndroidMkData {
				if ddoc.Javadoc.stubsSrcJar != nil {
					fmt.Fprintln(w, "LOCAL_DROIDDOC_STUBS_SRCJAR := ", ddoc.Javadoc.stubsSrcJar.String())
				}
				if ddoc.annotationsZip != nil {
					fmt.Fprintln(w, "LOCAL_DROIDDOC_ANNOTATIONS_ZIP := ", ddoc.annotationsZip.String())
				}
				if ddoc.checkCurrentApiTimestamp != nil {
					fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-check-current-api")
					fmt.Fprintln(w, ddoc.Name()+"-check-current-api:",
+5 −3
Original line number Diff line number Diff line
@@ -302,6 +302,8 @@ type Droiddoc struct {
	checkCurrentApiTimestamp      android.WritablePath
	updateCurrentApiTimestamp     android.WritablePath
	checkLastReleasedApiTimestamp android.WritablePath

	annotationsZip android.WritablePath
}

func InitDroiddocModule(module android.DefaultableModule, hod android.HostOrDeviceSupported) {
@@ -965,8 +967,8 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
			}
			opts += " --include-annotations --migrate-nullness"

			annotationsZip := android.PathForModuleOut(ctx, ctx.ModuleName()+"_annotations.zip")
			implicitOutputs = append(implicitOutputs, annotationsZip)
			d.annotationsZip = android.PathForModuleOut(ctx, ctx.ModuleName()+"_annotations.zip")
			implicitOutputs = append(implicitOutputs, d.annotationsZip)

			if String(d.properties.Metalava_merge_annotations_dir) == "" {
				ctx.PropertyErrorf("metalava_merge_annotations",
@@ -975,7 +977,7 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) {

			mergeAnnotationsDir := android.PathForSource(ctx, String(d.properties.Metalava_merge_annotations_dir))

			opts += " --extract-annotations " + annotationsZip.String() + " --merge-annotations " + mergeAnnotationsDir.String()
			opts += " --extract-annotations " + d.annotationsZip.String() + " --merge-annotations " + mergeAnnotationsDir.String()
			// TODO(tnorbye): find owners to fix these warnings when annotation was enabled.
			opts += " --hide HiddenTypedefConstant --hide SuperfluousPrefix --hide AnnotationExtraction"
		}