Merge "Create a new mode in soong_ui to generate API only BUILD files"

This commit is contained in:
Spandan Das
2022-10-05 01:37:28 +00:00
committed by Gerrit Code Review
14 changed files with 288 additions and 25 deletions

View File

@@ -1853,3 +1853,27 @@ filegroup {
},
})
}
func TestGenerateApiBazelTargets(t *testing.T) {
bp := `
custom {
name: "foo",
api: "foo.txt",
}
`
expectedBazelTarget := MakeBazelTarget(
"custom_api_contribution",
"foo",
AttrNameToString{
"api": `"foo.txt"`,
},
)
registerCustomModule := func(ctx android.RegistrationContext) {
ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
}
RunApiBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
Blueprint: bp,
ExpectedBazelTargets: []string{expectedBazelTarget},
Description: "Generating API contribution Bazel targets for custom module",
})
}