Add hidden_api_packages to java_sdk_library

hidden_api_packages is used to set packages that must be hidden from the
API. org.apache.http.legacy will be using this to exclude
references to com.android.okhttp from its API signatures.

Bug: 77575606
Test: m -j
Change-Id: Ic93c67cab96585638921dc922f175e545a68ead2
This commit is contained in:
Jiyong Park 2018-05-01 22:25:41 +09:00
parent 8959e149b7
commit 5a2c9d7a46
1 changed files with 4 additions and 0 deletions

View File

@ -102,6 +102,9 @@ type sdkLibraryProperties struct {
// list of package names that will be documented and publicized as API // list of package names that will be documented and publicized as API
Api_packages []string Api_packages []string
// list of package names that must be hidden from the API
Hidden_api_packages []string
// TODO: determines whether to create HTML doc or not // TODO: determines whether to create HTML doc or not
//Html_doc *bool //Html_doc *bool
} }
@ -319,6 +322,7 @@ func (module *sdkLibrary) createDocs(mctx android.TopDownMutatorContext, apiScop
droiddocArgs := " -hide 110 -hide 111 -hide 113 -hide 121 -hide 125 -hide 126 -hide 127 -hide 128" + droiddocArgs := " -hide 110 -hide 111 -hide 113 -hide 121 -hide 125 -hide 126 -hide 127 -hide 128" +
" -stubpackages " + strings.Join(module.properties.Api_packages, ":") + " -stubpackages " + strings.Join(module.properties.Api_packages, ":") +
" " + android.JoinWithPrefix(module.properties.Hidden_api_packages, "-hidePackage ") +
" -nodocs" " -nodocs"
switch apiScope { switch apiScope {
case apiScopeSystem: case apiScopeSystem: