Respect package boundaries in bp2build conversion of go modules

bp2build's codegen context does not implement
BazelPathConversionContext. To reuse the utility function
transformPackagePaths, update its signature

(Also make deps of go_library unique to make the conversion resilient)

Test: go test ./bp2build
Change-Id: I126b1057d2b26bc6c7d3be2780f1b62d28323cf0
This commit is contained in:
Spandan Das
2023-06-21 01:50:33 +00:00
parent 69afa98fbd
commit 0a8a27500e
4 changed files with 53 additions and 22 deletions

View File

@@ -175,7 +175,7 @@ func TestTransformSubpackagePath(t *testing.T) {
"./z/b.c": "z/b.c",
}
for in, out := range pairs {
actual := transformSubpackagePath(ctx, bazel.Label{Label: in}).Label
actual := transformSubpackagePath(ctx.Config(), ctx.ModuleDir(), bazel.Label{Label: in}).Label
if actual != out {
t.Errorf("expected:\n%v\nactual:\n%v", out, actual)
}