Merge "Output Javadoc comments for public API" am: d124b6b4e8
am: b3bc8c5eb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1439053 Change-Id: I2cacbb7c946f06153b7f4f1e9ad0df3f8e97a026
This commit is contained in:
@@ -253,6 +253,10 @@ type DroidstubsProperties struct {
|
|||||||
// if set to true, allow Metalava to generate doc_stubs source files. Defaults to false.
|
// if set to true, allow Metalava to generate doc_stubs source files. Defaults to false.
|
||||||
Create_doc_stubs *bool
|
Create_doc_stubs *bool
|
||||||
|
|
||||||
|
// if set to true, cause Metalava to output Javadoc comments in the stubs source files. Defaults to false.
|
||||||
|
// Has no effect if create_doc_stubs: true.
|
||||||
|
Output_javadoc_comments *bool
|
||||||
|
|
||||||
// if set to false then do not write out stubs. Defaults to true.
|
// if set to false then do not write out stubs. Defaults to true.
|
||||||
//
|
//
|
||||||
// TODO(b/146727827): Remove capability when we do not need to generate stubs and API separately.
|
// TODO(b/146727827): Remove capability when we do not need to generate stubs and API separately.
|
||||||
@@ -1150,10 +1154,12 @@ func (d *Droidstubs) stubsFlags(ctx android.ModuleContext, cmd *android.RuleBuil
|
|||||||
cmd.FlagWithArg("--doc-stubs ", stubsDir.String())
|
cmd.FlagWithArg("--doc-stubs ", stubsDir.String())
|
||||||
} else {
|
} else {
|
||||||
cmd.FlagWithArg("--stubs ", stubsDir.String())
|
cmd.FlagWithArg("--stubs ", stubsDir.String())
|
||||||
|
if !Bool(d.properties.Output_javadoc_comments) {
|
||||||
cmd.Flag("--exclude-documentation-from-stubs")
|
cmd.Flag("--exclude-documentation-from-stubs")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (d *Droidstubs) annotationsFlags(ctx android.ModuleContext, cmd *android.RuleBuilderCommand) {
|
func (d *Droidstubs) annotationsFlags(ctx android.ModuleContext, cmd *android.RuleBuilderCommand) {
|
||||||
if Bool(d.properties.Annotations_enabled) {
|
if Bool(d.properties.Annotations_enabled) {
|
||||||
|
@@ -1203,6 +1203,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
|||||||
Sdk_version *string
|
Sdk_version *string
|
||||||
System_modules *string
|
System_modules *string
|
||||||
Libs []string
|
Libs []string
|
||||||
|
Output_javadoc_comments *bool
|
||||||
Arg_files []string
|
Arg_files []string
|
||||||
Args *string
|
Args *string
|
||||||
Java_version *string
|
Java_version *string
|
||||||
@@ -1278,6 +1279,11 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
|||||||
}
|
}
|
||||||
droidstubsArgs = append(droidstubsArgs, android.JoinWithPrefix(disabledWarnings, "--hide "))
|
droidstubsArgs = append(droidstubsArgs, android.JoinWithPrefix(disabledWarnings, "--hide "))
|
||||||
|
|
||||||
|
// Output Javadoc comments for public scope.
|
||||||
|
if apiScope == apiScopePublic {
|
||||||
|
props.Output_javadoc_comments = proptools.BoolPtr(true)
|
||||||
|
}
|
||||||
|
|
||||||
// Add in scope specific arguments.
|
// Add in scope specific arguments.
|
||||||
droidstubsArgs = append(droidstubsArgs, scopeSpecificDroidstubsArgs...)
|
droidstubsArgs = append(droidstubsArgs, scopeSpecificDroidstubsArgs...)
|
||||||
props.Arg_files = module.sdkLibraryProperties.Droiddoc_option_files
|
props.Arg_files = module.sdkLibraryProperties.Droiddoc_option_files
|
||||||
|
Reference in New Issue
Block a user