diff options
| author | 2021-04-27 23:20:26 +0100 | |
|---|---|---|
| committer | 2021-04-27 23:27:34 +0100 | |
| commit | 976b0e5bbbc4341e5be0b0a3504f072a24a39cd6 (patch) | |
| tree | 2934e72c4f0d7ecd081cc960ed4680cf06a96502 /java/hiddenapi_modular.go | |
| parent | eee466e4391f0821769096bb36674cf2b4a1bff7 (diff) | |
Automatically export bootclasspath_fragment stubs from sdk
This change makes the tag that is used to add dependencies onto stubs
from the bootclaspath_fragment module cause the dependency to be
automatically exported from the sdk. If the dependency is a
java_sdk_library then it will be as if it was added to the
java_sdk_libs property, otherwise it will be as if it was added to the
java_header_libs property instead.
Bug: 177892522
Test: m nothing
Change-Id: I97010c4342dd39415dba81a4395db7831410436e
Diffstat (limited to 'java/hiddenapi_modular.go')
| -rw-r--r-- | java/hiddenapi_modular.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go index 8cc6f8f23..793d63ae7 100644 --- a/java/hiddenapi_modular.go +++ b/java/hiddenapi_modular.go @@ -33,6 +33,21 @@ func (b hiddenAPIStubsDependencyTag) ReplaceSourceWithPrebuilt() bool { return false } +func (b hiddenAPIStubsDependencyTag) SdkMemberType(child android.Module) android.SdkMemberType { + // If the module is a java_sdk_library then treat it as if it was specific in the java_sdk_libs + // property, otherwise treat if it was specified in the java_header_libs property. + if javaSdkLibrarySdkMemberType.IsInstance(child) { + return javaSdkLibrarySdkMemberType + } + + return javaHeaderLibsSdkMemberType +} + +func (b hiddenAPIStubsDependencyTag) ExportMember() bool { + // Export the module added via this dependency tag from the sdk. + return true +} + // Avoid having to make stubs content explicitly visible to dependent modules. // // This is a temporary workaround to make it easier to migrate to bootclasspath_fragment modules @@ -44,6 +59,7 @@ func (b hiddenAPIStubsDependencyTag) ExcludeFromVisibilityEnforcement() { var _ android.ExcludeFromVisibilityEnforcementTag = hiddenAPIStubsDependencyTag{} var _ android.ReplaceSourceWithPrebuilt = hiddenAPIStubsDependencyTag{} var _ android.ExcludeFromApexContentsTag = hiddenAPIStubsDependencyTag{} +var _ android.SdkMemberTypeDependencyTag = hiddenAPIStubsDependencyTag{} // hiddenAPIRelevantSdkKinds lists all the android.SdkKind instances that are needed by the hidden // API processing. |