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
This commit is contained in:
@@ -33,6 +33,21 @@ func (b hiddenAPIStubsDependencyTag) ReplaceSourceWithPrebuilt() bool {
|
|||||||
return false
|
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.
|
// 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
|
// 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.ExcludeFromVisibilityEnforcementTag = hiddenAPIStubsDependencyTag{}
|
||||||
var _ android.ReplaceSourceWithPrebuilt = hiddenAPIStubsDependencyTag{}
|
var _ android.ReplaceSourceWithPrebuilt = hiddenAPIStubsDependencyTag{}
|
||||||
var _ android.ExcludeFromApexContentsTag = hiddenAPIStubsDependencyTag{}
|
var _ android.ExcludeFromApexContentsTag = hiddenAPIStubsDependencyTag{}
|
||||||
|
var _ android.SdkMemberTypeDependencyTag = hiddenAPIStubsDependencyTag{}
|
||||||
|
|
||||||
// hiddenAPIRelevantSdkKinds lists all the android.SdkKind instances that are needed by the hidden
|
// hiddenAPIRelevantSdkKinds lists all the android.SdkKind instances that are needed by the hidden
|
||||||
// API processing.
|
// API processing.
|
||||||
|
@@ -339,12 +339,7 @@ func init() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Register sdk member types.
|
// Register sdk member types.
|
||||||
android.RegisterSdkMemberType(&sdkLibrarySdkMemberType{
|
android.RegisterSdkMemberType(javaSdkLibrarySdkMemberType)
|
||||||
android.SdkMemberTypeBase{
|
|
||||||
PropertyName: "java_sdk_libs",
|
|
||||||
SupportsSdk: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterSdkLibraryBuildComponents(ctx android.RegistrationContext) {
|
func RegisterSdkLibraryBuildComponents(ctx android.RegistrationContext) {
|
||||||
@@ -2377,6 +2372,13 @@ func (s *sdkLibrarySdkMemberType) CreateVariantPropertiesStruct() android.SdkMem
|
|||||||
return &sdkLibrarySdkMemberProperties{}
|
return &sdkLibrarySdkMemberProperties{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var javaSdkLibrarySdkMemberType = &sdkLibrarySdkMemberType{
|
||||||
|
android.SdkMemberTypeBase{
|
||||||
|
PropertyName: "java_sdk_libs",
|
||||||
|
SupportsSdk: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
type sdkLibrarySdkMemberProperties struct {
|
type sdkLibrarySdkMemberProperties struct {
|
||||||
android.SdkMemberPropertiesBase
|
android.SdkMemberPropertiesBase
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user