platform_build_soong/python
Spandan Das c53767e434 Handle .proto files that end up in a different package
Bazel poses a strict requirement that .proto files and proto_library
must be in the same package. This CL handles this automatically by
creating the proto_library in a separate dir/package if necessary

Implementation details
- Partition the `srcs` by package. `srcs` has been computed using
  `transformSubpackagePath`, so the information about packages is
  available at this point
- Create a proto_library in each package by using
  `CommonAttributes.Dir`. Collect all these additional libraries
  and put them in `info.Proto_libraries` so that they get added as deps
  of (cc|python|...)_proto_library
- Add an import_prefix to the proto_library in subpackages relative to
  the current directory. This relies on the assumption that every src is
  beneath the current directory (Soong will complain if a path in
  Android.bp contains ../)

filegroup module type uses a separate code-path to create proto_library.
This will be handled in the next CL in stack.

Test: bp2build unit tests
Test: TH
Test: Built the failing internal module mentioned in
b/292583584#comment1

Bug: 292583584

Change-Id: I437fc89092321b26c5f0511387cde9e84084d6f9
2023-08-07 19:18:03 +00:00
..
scripts stub_template_host redirect SIGINT and SIGTERM to subprocess 2023-03-22 00:17:24 +00:00
tests Delete Python 2 embedded launcher test. 2023-05-04 17:52:12 +00:00
Android.bp Precompile python sources 2023-01-27 15:43:38 -08:00
binary.go bp2build support for python_test(_host) 2023-04-13 16:10:59 -07:00
bp2build.go Handle .proto files that end up in a different package 2023-08-07 19:18:03 +00:00
builder.go Precompile python sources 2023-01-27 15:43:38 -08:00
defaults.go Fix some issues in bp2build converter for python_binary_host. 2022-10-12 17:43:20 -07:00
library.go Refactor python rules 2023-01-25 10:40:59 -08:00
proto.go Remove flags that enable the new python path behavior 2022-10-21 16:07:56 -07:00
python.go Delete Python 2 embedded launcher test. 2023-05-04 17:52:12 +00:00
python_test.go Precompile python sources 2023-01-27 15:43:38 -08:00
test.go Add data_device_bins_both properties for python_test_host 2023-05-19 10:32:49 -07:00
testing.go Add preparers for python 2021-03-17 23:56:29 +00:00