Remove bp2build deps mutator

Refactor bp2build to retrieve modules directly by name, instead of via
DirectDeps. This functions properly as bp2build has no need for variant
information of the blueprint graph.

Test: USE_BAZEL_ANALYSIS=1 m fmtlib
Change-Id: Ief4b67bc56f24929871af772f3a742f07085bf8c
This commit is contained in:
Chris Parsons
2021-07-21 14:34:58 -04:00
parent 561923e10d
commit 5a34ffb350
11 changed files with 56 additions and 232 deletions

View File

@@ -73,9 +73,6 @@ func runBp2BuildTestCase(t *testing.T, registerModuleTypes func(ctx android.Regi
registerModuleTypes(ctx)
ctx.RegisterModuleType(tc.moduleTypeUnderTest, tc.moduleTypeUnderTestFactory)
ctx.RegisterBp2BuildConfig(bp2buildConfig)
for _, m := range tc.depsMutators {
ctx.DepsBp2BuildMutators(m)
}
ctx.RegisterBp2BuildMutator(tc.moduleTypeUnderTest, tc.moduleTypeUnderTestBp2BuildMutator)
ctx.RegisterForBazelConversion()
@@ -333,7 +330,6 @@ func TestCcLibrarySharedStaticProps(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/both.cpp": "",
@@ -418,7 +414,6 @@ func TestCcLibraryWholeStaticLibsAlwaysLink(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -465,7 +460,6 @@ func TestCcLibrarySharedStaticPropsInArch(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/arm.cpp": "",
@@ -604,7 +598,6 @@ func TestCcLibrarySharedStaticPropsWithMixedSources(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/both_source.cpp": "",
@@ -745,7 +738,6 @@ func TestCcLibraryNonConfiguredVersionScript(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -776,7 +768,6 @@ func TestCcLibraryConfiguredVersionScript(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -819,7 +810,6 @@ func TestCcLibrarySharedLibs(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -859,7 +849,6 @@ func TestCcLibraryPackRelocations(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -933,7 +922,6 @@ func TestCcLibrarySpacesInCopts(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -963,7 +951,6 @@ func TestCcLibraryCppFlagsGoesIntoCopts(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `cc_library {
@@ -1019,7 +1006,6 @@ func TestCcLibraryLabelAttributeGetTargetProperties(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -1061,7 +1047,6 @@ func TestCcLibraryExcludeLibs(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
filesystem: map[string]string{},
blueprint: soongCcLibraryStaticPreamble + `
cc_library {
@@ -1308,7 +1293,6 @@ func TestCcLibraryStrip(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
@@ -1415,7 +1399,6 @@ func TestCcLibraryStripWithArch(t *testing.T) {
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `