Commit graph

5 commits

Author SHA1 Message Date
Spandan Das
03010664c8 Add a function to find src labels in a specific directory
The existing api restricts search to the directory of the currently
visited soong module. Create a new function that allows search in any
directory. Internally it calls TransformSubpackagePath so the returned
labels will be resolved to respect package boundaries.

The use case for this is to support proto.include_dirs of cc_*, java_*,
python_*

Test: Added a unit test that uses a mock for GlobWihDeps

Change-Id: I75fe3ca7de88b163f456190049a22c62f91c9a2e
2023-08-16 01:15:48 +00:00
Liz Kammer
c86e094e13 Make ShouldConvertWithBp2build avail in loadhooks
Test: Soong go tests
Change-Id: I65af040152107ce50b1a97efcee9364f28bad08b
2023-08-14 11:03:05 -04:00
Spandan Das
0a8a27500e 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
2023-07-13 00:22:26 +00:00
Usta Shrestha
d558031e0c File paths to allow "./" prefix
bazel_path conversion would treat "./" as a package boundary
  which would be incorrect

Bug: b/243072036
Test: unit test build_conversion_test.go and `m libc`
Change-Id: I0fc44d2fd7a4270442c8755219a11fd585244c5c
2022-09-26 14:44:15 -04:00
Cole Faust
9a06d25be2 Make filegroup paths relative to module dir in mixed builds
filegroup.srcs must have a .rel() version of their paths
that is relative to the module directory. Previously in
mixed builds, the relative path wasn't filled in.

Bug: 229251008
Bug: 204244290
Test: go tests, and USE_BAZEL_ANALYSIS=1 m apexer with the following cl
Change-Id: I11a2a8b96139e0e7b956fa4c256a9a99c02f88f3
2022-06-08 11:47:24 -07:00