Modify static lib stub library visiblity

java_sdk_library generates stub java_library module which compiles the
stub generated from either source or txt files, which is toggled based
on the build configuration. The java_api_library/java_library module
that compiles the stubs should not be directly accessible to the modules
outside of the sdk_library module scope, thus modify their visibility as
private.

Test: m nothing
Bug: 299373105
Change-Id: Ia4a08bf6e65c521814c82f54ea43cc8d367834e3
This commit is contained in:
Jihoon Kang
2023-09-07 01:18:31 +00:00
parent 55e775f94f
commit 786df93db0
2 changed files with 31 additions and 2 deletions

View File

@@ -1633,7 +1633,7 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.DefaultableHookContext
}{}
props.Name = proptools.StringPtr(module.sourceStubLibraryModuleName(apiScope))
props.Visibility = childModuleVisibility(module.sdkLibraryProperties.Stubs_library_visibility)
props.Visibility = []string{"//visibility:override", "//visibility:private"}
// sources are generated from the droiddoc
props.Srcs = []string{":" + module.stubsSourceModuleName(apiScope)}
sdkVersion := module.sdkVersionForStubsLibrary(mctx, apiScope)
@@ -1829,7 +1829,7 @@ func (module *SdkLibrary) createApiLibrary(mctx android.DefaultableHookContext,
}{}
props.Name = proptools.StringPtr(module.apiLibraryModuleName(apiScope))
props.Visibility = childModuleVisibility(module.sdkLibraryProperties.Stubs_library_visibility)
props.Visibility = []string{"//visibility:override", "//visibility:private"}
apiContributions := []string{}