refactoring build_conversion.go to remove panic

Returning errors throughout instead of calling panic()
Errors will be more useful for testing

Test: bp2build tests
Change-Id: I3b03f0a30e7a80878e91c7f0e2df5a94d9d6b780
This commit is contained in:
Alix
2022-08-16 20:37:33 +00:00
parent 5aa5dc4121
commit 94e2603ab7
2 changed files with 64 additions and 32 deletions

View File

@@ -384,6 +384,9 @@ func customBp2buildOneToMany(ctx android.TopDownMutatorContext, m *customModule)
func generateBazelTargetsForDir(codegenCtx *CodegenContext, dir string) (BazelTargets, []error) {
// TODO: Set generateFilegroups to true and/or remove the generateFilegroups argument completely
res, err := GenerateBazelTargets(codegenCtx, false)
if err != nil {
return BazelTargets{}, err
}
return res.buildFileToTargets[dir], err
}