Revert "Revert "Revert "Add aidl.deps prop to include aidl implicit deps explicitly in Android.bp"""
This reverts commit e3e7711ac6
.
Reason for revert: CI fixed
(cherry picked from https://android-review.googlesource.com/q/commit:21bfa5816dab69110c345b9d020dcab3df1402e8)
Merged-In: Ib038241eae5ec6af78ac24105c891db55a4d0544
Change-Id: Ib038241eae5ec6af78ac24105c891db55a4d0544
This commit is contained in:
committed by
Cherrypicker Worker
parent
992d5142d2
commit
10cd5f9e4d
@@ -82,7 +82,6 @@ type bazelFilegroupAttributes struct {
|
|||||||
type bazelAidlLibraryAttributes struct {
|
type bazelAidlLibraryAttributes struct {
|
||||||
Srcs bazel.LabelListAttribute
|
Srcs bazel.LabelListAttribute
|
||||||
Strip_import_prefix *string
|
Strip_import_prefix *string
|
||||||
Deps bazel.LabelListAttribute
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// api srcs can be contained in filegroups.
|
// api srcs can be contained in filegroups.
|
||||||
@@ -121,12 +120,9 @@ func (fg *fileGroup) ConvertWithBp2build(ctx TopDownMutatorContext) {
|
|||||||
// and then convert
|
// and then convert
|
||||||
if fg.ShouldConvertToAidlLibrary(ctx) {
|
if fg.ShouldConvertToAidlLibrary(ctx) {
|
||||||
tags := []string{"apex_available=//apex_available:anyapex"}
|
tags := []string{"apex_available=//apex_available:anyapex"}
|
||||||
deps := bazel.MakeLabelListAttribute(BazelLabelForModuleDeps(ctx, fg.properties.Aidl.Deps))
|
|
||||||
|
|
||||||
attrs := &bazelAidlLibraryAttributes{
|
attrs := &bazelAidlLibraryAttributes{
|
||||||
Srcs: srcs,
|
Srcs: srcs,
|
||||||
Strip_import_prefix: fg.properties.Path,
|
Strip_import_prefix: fg.properties.Path,
|
||||||
Deps: deps,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
props := bazel.BazelTargetModuleProperties{
|
props := bazel.BazelTargetModuleProperties{
|
||||||
@@ -192,14 +188,6 @@ type fileGroupProperties struct {
|
|||||||
// Create a make variable with the specified name that contains the list of files in the
|
// Create a make variable with the specified name that contains the list of files in the
|
||||||
// filegroup, relative to the root of the source tree.
|
// filegroup, relative to the root of the source tree.
|
||||||
Export_to_make_var *string
|
Export_to_make_var *string
|
||||||
|
|
||||||
// aidl is explicitly provided for implicit aidl dependencies
|
|
||||||
// TODO(b/278298615): aidl prop is a no-op in Soong and is an escape hatch
|
|
||||||
// to include implicit aidl dependencies for bazel migration compatibility
|
|
||||||
Aidl struct {
|
|
||||||
// List of aidl files or filegroup depended on by srcs
|
|
||||||
Deps []string `android:"path"`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type fileGroup struct {
|
type fileGroup struct {
|
||||||
|
@@ -105,42 +105,6 @@ func TestFilegroupWithAidlSrcs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilegroupWithAidlDeps(t *testing.T) {
|
|
||||||
bp := `
|
|
||||||
filegroup {
|
|
||||||
name: "bar",
|
|
||||||
srcs: ["bar.aidl"],
|
|
||||||
}
|
|
||||||
filegroup {
|
|
||||||
name: "foo",
|
|
||||||
srcs: ["aidl/foo.aidl"],
|
|
||||||
path: "aidl",
|
|
||||||
aidl: {
|
|
||||||
deps: [":bar"],
|
|
||||||
}
|
|
||||||
}`
|
|
||||||
|
|
||||||
t.Run("filegroup with aidl deps", func(t *testing.T) {
|
|
||||||
expectedBazelTargets := []string{
|
|
||||||
MakeBazelTargetNoRestrictions("aidl_library", "bar", AttrNameToString{
|
|
||||||
"srcs": `["bar.aidl"]`,
|
|
||||||
"tags": `["apex_available=//apex_available:anyapex"]`,
|
|
||||||
}),
|
|
||||||
MakeBazelTargetNoRestrictions("aidl_library", "foo", AttrNameToString{
|
|
||||||
"srcs": `["aidl/foo.aidl"]`,
|
|
||||||
"strip_import_prefix": `"aidl"`,
|
|
||||||
"deps": `[":bar"]`,
|
|
||||||
"tags": `["apex_available=//apex_available:anyapex"]`,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
runFilegroupTestCase(t, Bp2buildTestCase{
|
|
||||||
Description: "filegroup with aidl deps",
|
|
||||||
Blueprint: bp,
|
|
||||||
ExpectedBazelTargets: expectedBazelTargets,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestFilegroupWithAidlAndNonAidlSrcs(t *testing.T) {
|
func TestFilegroupWithAidlAndNonAidlSrcs(t *testing.T) {
|
||||||
runFilegroupTestCase(t, Bp2buildTestCase{
|
runFilegroupTestCase(t, Bp2buildTestCase{
|
||||||
Description: "filegroup with aidl and non-aidl srcs",
|
Description: "filegroup with aidl and non-aidl srcs",
|
||||||
|
Reference in New Issue
Block a user