Add apex_available aidl + aidl&lang libraries

Test: b build com.android.neuralnetworks com.android.media.swcodec
Change-Id: I008b915b22e4c8c2cf1f0aee6cfdaf17374cb3a9
This commit is contained in:
Liz Kammer
2023-03-23 11:51:49 -04:00
parent 10e5a0e987
commit 2b3f56ed22
8 changed files with 55 additions and 14 deletions

View File

@@ -2625,10 +2625,12 @@ type eventLogTagsAttributes struct {
type aidlLibraryAttributes struct {
Srcs bazel.LabelListAttribute
Tags bazel.StringListAttribute
}
type javaAidlLibraryAttributes struct {
Deps bazel.LabelListAttribute
Tags bazel.StringListAttribute
}
// bp2BuildJavaInfo has information needed for the conversion of java*_modules
@@ -2700,6 +2702,8 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
return android.IsConvertedToAidlLibrary(ctx, src.OriginalModuleName)
})
apexAvailableTags := android.ApexAvailableTags(ctx.Module())
if !aidlSrcs.IsEmpty() {
aidlLibName := m.Name() + "_aidl_library"
ctx.CreateBazelTargetModule(
@@ -2710,6 +2714,7 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
android.CommonAttributes{Name: aidlLibName},
&aidlLibraryAttributes{
Srcs: aidlSrcs,
Tags: apexAvailableTags,
},
)
aidlLibs.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + aidlLibName}})
@@ -2724,6 +2729,7 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
android.CommonAttributes{Name: javaAidlLibName},
&javaAidlLibraryAttributes{
Deps: aidlLibs,
Tags: apexAvailableTags,
},
)