Turn droiddoc's metalava_merge_annotations_dir into a list.
This change replaces droiddoc's metalava_merge_annotations_dir parameter (which takes a single value) with metalava_merge_annotations_dirs (which takes a list). This will makes it possible to merge libcore annotations in from a separate directory under ojluni, instead of adding them in a preprocessing step. It is implemented by passing the --merge-annotations argument to metalava multiple times, which is already supported by metalava's command line parsing. Test: `make metalava-api-stubs-docs` with a local change to add a second directory in //frameworks/base/Android.bp Bug: 111639530 Change-Id: I53d31f1dd45c13405b4511c2b44cbeb7f0e439d1
This commit is contained in:
@@ -262,8 +262,8 @@ type DroiddocProperties struct {
|
|||||||
// is set to true, Metalava will allow framework SDK to contain annotations.
|
// is set to true, Metalava will allow framework SDK to contain annotations.
|
||||||
Metalava_annotations_enabled *bool
|
Metalava_annotations_enabled *bool
|
||||||
|
|
||||||
// a top level directory contains XML files set to merge annotations.
|
// a list of top-level directories containing files to merge annotations from.
|
||||||
Metalava_merge_annotations_dir *string
|
Metalava_merge_annotations_dirs []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Javadoc struct {
|
type Javadoc struct {
|
||||||
@@ -970,14 +970,16 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
d.annotationsZip = android.PathForModuleOut(ctx, ctx.ModuleName()+"_annotations.zip")
|
d.annotationsZip = android.PathForModuleOut(ctx, ctx.ModuleName()+"_annotations.zip")
|
||||||
implicitOutputs = append(implicitOutputs, d.annotationsZip)
|
implicitOutputs = append(implicitOutputs, d.annotationsZip)
|
||||||
|
|
||||||
if String(d.properties.Metalava_merge_annotations_dir) == "" {
|
if len(d.properties.Metalava_merge_annotations_dirs) == 0 {
|
||||||
ctx.PropertyErrorf("metalava_merge_annotations",
|
ctx.PropertyErrorf("metalava_merge_annotations_dirs",
|
||||||
"has to be non-empty if annotations was enabled!")
|
"has to be non-empty if annotations was enabled!")
|
||||||
}
|
}
|
||||||
|
mergeAnnotationsDirs := android.PathsForSource(ctx, d.properties.Metalava_merge_annotations_dirs)
|
||||||
|
|
||||||
mergeAnnotationsDir := android.PathForSource(ctx, String(d.properties.Metalava_merge_annotations_dir))
|
opts += " --extract-annotations " + d.annotationsZip.String()
|
||||||
|
for _, mergeAnnotationsDir := range mergeAnnotationsDirs {
|
||||||
opts += " --extract-annotations " + d.annotationsZip.String() + " --merge-annotations " + mergeAnnotationsDir.String()
|
opts += " --merge-annotations " + mergeAnnotationsDir.String()
|
||||||
|
}
|
||||||
// TODO(tnorbye): find owners to fix these warnings when annotation was enabled.
|
// TODO(tnorbye): find owners to fix these warnings when annotation was enabled.
|
||||||
opts += " --hide HiddenTypedefConstant --hide SuperfluousPrefix --hide AnnotationExtraction"
|
opts += " --hide HiddenTypedefConstant --hide SuperfluousPrefix --hide AnnotationExtraction"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user