Merge "java_sdk_library: construct droidstubs args as []string" am: 0a83b7961c am: bc1aa20ebb

Change-Id: I2c068042ef805092b4d0dae82d49219f7301e676
This commit is contained in:
Automerger Merge Worker
2020-01-02 14:57:07 +00:00

View File

@@ -531,21 +531,36 @@ func (module *SdkLibrary) createDocs(mctx android.LoadHookContext, apiScope apiS
props.Merge_annotations_dirs = module.sdkLibraryProperties.Merge_annotations_dirs props.Merge_annotations_dirs = module.sdkLibraryProperties.Merge_annotations_dirs
props.Merge_inclusion_annotations_dirs = module.sdkLibraryProperties.Merge_inclusion_annotations_dirs props.Merge_inclusion_annotations_dirs = module.sdkLibraryProperties.Merge_inclusion_annotations_dirs
droiddocArgs := " --stub-packages " + strings.Join(module.sdkLibraryProperties.Api_packages, ":") + droiddocArgs := []string{}
" " + android.JoinWithPrefix(module.sdkLibraryProperties.Hidden_api_packages, " --hide-package ") + if len(module.sdkLibraryProperties.Api_packages) != 0 {
" " + android.JoinWithPrefix(module.sdkLibraryProperties.Droiddoc_options, " ") + droiddocArgs = append(droiddocArgs, "--stub-packages "+strings.Join(module.sdkLibraryProperties.Api_packages, ":"))
" --hide MissingPermission --hide BroadcastBehavior " + }
"--hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol " + if len(module.sdkLibraryProperties.Hidden_api_packages) != 0 {
"--hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo" droiddocArgs = append(droiddocArgs,
android.JoinWithPrefix(module.sdkLibraryProperties.Hidden_api_packages, " --hide-package "))
}
droiddocArgs = append(droiddocArgs, module.sdkLibraryProperties.Droiddoc_options...)
disabledWarnings := []string{
"MissingPermission",
"BroadcastBehavior",
"HiddenSuperclass",
"DeprecationMismatch",
"UnavailableSymbol",
"SdkConstant",
"HiddenTypeParameter",
"Todo",
"Typo",
}
droiddocArgs = append(droiddocArgs, android.JoinWithPrefix(disabledWarnings, "--hide "))
switch apiScope { switch apiScope {
case apiScopeSystem: case apiScopeSystem:
droiddocArgs = droiddocArgs + " -showAnnotation android.annotation.SystemApi" droiddocArgs = append(droiddocArgs, "-showAnnotation android.annotation.SystemApi")
case apiScopeTest: case apiScopeTest:
droiddocArgs = droiddocArgs + " -showAnnotation android.annotation.TestApi" droiddocArgs = append(droiddocArgs, " -showAnnotation android.annotation.TestApi")
} }
props.Arg_files = module.sdkLibraryProperties.Droiddoc_option_files props.Arg_files = module.sdkLibraryProperties.Droiddoc_option_files
props.Args = proptools.StringPtr(droiddocArgs) props.Args = proptools.StringPtr(strings.Join(droiddocArgs, " "))
// List of APIs identified from the provided source files are created. They are later // List of APIs identified from the provided source files are created. They are later
// compared against to the not-yet-released (a.k.a current) list of APIs and to the // compared against to the not-yet-released (a.k.a current) list of APIs and to the