Merge "Automatically add bootclasspath_fragment contents to sdk" am: 56d3ea4998 am: 7d43ff1fd8

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686126

Change-Id: I2adc481b5f3716bba1410120643e77cd91ad5c9b
This commit is contained in:
Paul Duffin
2021-04-26 23:12:05 +00:00
committed by Automerger Merge Worker
2 changed files with 14 additions and 5 deletions

View File

@@ -32,8 +32,9 @@ func init() {
android.RegisterSdkMemberType(&bootclasspathFragmentMemberType{ android.RegisterSdkMemberType(&bootclasspathFragmentMemberType{
SdkMemberTypeBase: android.SdkMemberTypeBase{ SdkMemberTypeBase: android.SdkMemberTypeBase{
PropertyName: "bootclasspath_fragments", PropertyName: "bootclasspath_fragments",
SupportsSdk: true, SupportsSdk: true,
TransitiveSdkMembers: true,
}, },
}) })
} }
@@ -60,11 +61,22 @@ func (b bootclasspathFragmentContentDependencyTag) ReplaceSourceWithPrebuilt() b
return false return false
} }
// SdkMemberType causes dependencies added with this tag to be automatically added to the sdk as if
// they were specified using java_boot_libs.
func (b bootclasspathFragmentContentDependencyTag) SdkMemberType() android.SdkMemberType {
return javaBootLibsSdkMemberType
}
func (b bootclasspathFragmentContentDependencyTag) ExportMember() bool {
return true
}
// The tag used for the dependency between the bootclasspath_fragment module and its contents. // The tag used for the dependency between the bootclasspath_fragment module and its contents.
var bootclasspathFragmentContentDepTag = bootclasspathFragmentContentDependencyTag{} var bootclasspathFragmentContentDepTag = bootclasspathFragmentContentDependencyTag{}
var _ android.ExcludeFromVisibilityEnforcementTag = bootclasspathFragmentContentDepTag var _ android.ExcludeFromVisibilityEnforcementTag = bootclasspathFragmentContentDepTag
var _ android.ReplaceSourceWithPrebuilt = bootclasspathFragmentContentDepTag var _ android.ReplaceSourceWithPrebuilt = bootclasspathFragmentContentDepTag
var _ android.SdkMemberTypeDependencyTag = bootclasspathFragmentContentDepTag
func IsBootclasspathFragmentContentDepTag(tag blueprint.DependencyTag) bool { func IsBootclasspathFragmentContentDepTag(tag blueprint.DependencyTag) bool {
return tag == bootclasspathFragmentContentDepTag return tag == bootclasspathFragmentContentDepTag

View File

@@ -52,7 +52,6 @@ func TestSnapshotWithBootclasspathFragment_ImageName(t *testing.T) {
sdk { sdk {
name: "mysdk", name: "mysdk",
bootclasspath_fragments: ["mybootclasspathfragment"], bootclasspath_fragments: ["mybootclasspathfragment"],
java_boot_libs: ["mybootlib"],
} }
apex { apex {
@@ -166,7 +165,6 @@ func TestSnapshotWithBootClasspathFragment_Contents(t *testing.T) {
sdk { sdk {
name: "mysdk", name: "mysdk",
bootclasspath_fragments: ["mybootclasspathfragment"], bootclasspath_fragments: ["mybootclasspathfragment"],
java_boot_libs: ["mybootlib"],
} }
bootclasspath_fragment { bootclasspath_fragment {
@@ -288,7 +286,6 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) {
sdk { sdk {
name: "mysdk", name: "mysdk",
bootclasspath_fragments: ["mybootclasspathfragment"], bootclasspath_fragments: ["mybootclasspathfragment"],
java_boot_libs: ["mybootlib"],
} }
bootclasspath_fragment { bootclasspath_fragment {