Correct genrule path references

Test: b build `bmod robolectric_tzdata`
Test: go test bp2build tests
Change-Id: I98333f2b9f480019ddca11944b455d484a47cf8e
This commit is contained in:
Liz Kammer
2023-06-02 19:03:06 -04:00
parent b25cbb3449
commit 1e75324ebd
3 changed files with 15 additions and 9 deletions

View File

@@ -242,6 +242,11 @@ func transformSubpackagePath(ctx BazelConversionPathContext, path bazel.Label) b
// Don't transform OriginalModuleName
newPath.OriginalModuleName = path.OriginalModuleName
// if it wasn't a module, store the original path. We may need the original path to replace
// references if it is actually in another package
if path.OriginalModuleName == "" {
newPath.OriginalModuleName = path.Label
}
if strings.HasPrefix(path.Label, "//") {
// Assume absolute labels are already correct (e.g. //path/to/some/package:foo.h)