Commit graph

15 commits

Author SHA1 Message Date
Liz Kammer
5f5dbaad65 Handle xsd config more like other partitions
This is prep work to add additional special handling for genrule
generated headers as there will be similar partitioning for those
headers.

Test: go test soong tests
Change-Id: Ib63e7e4f7554b2b7b7bc78b2825b20c05403216a
2023-07-24 13:01:22 -04:00
Cole Faust
150f9a5a63 Bp2build support for soong config variables + os
For converting the art plugins to pure soong, it would be useful to
have a property that's qualified on both a soong config variable and
the OS. Soong had very little-known support for this by saying your
soong config variable changes the "target.android.cflags" property,
and we didn't supporting bp2building that. Add the bp2build support.

This cl also refactors product variable and soong variable bp2building
so that they're separate from each other, which I think makes the code
easier to understand.

Test: go test
Change-Id: Ic74dc75da8103fa2523da95c3560c9ce3c5e5672
2023-05-08 17:50:06 -07:00
Liz Kammer
748d70786c Correct global excludes not always being excluded
Test: bp2build go tests
Fixes: 266617441
Change-Id: I82418ef8da4cca880d5adac98853805a18a9780e
2023-01-26 11:16:39 -05:00
Alix
bbfd538326 product_variables srcs in prebuilt_etc
bp2build conversion handles product_variable srcs

bug: 228353067
Test: prebuilt_etc_conversion_test.go
Change-Id: I82d3a384ee14d4e981d502dd9eb824c87d5ae2c7
2022-09-09 20:52:09 +00:00
Sam Delmerico
c1130dc721 add Partition method to LabelListAttribute
It can be tedious to split a LabelListAttribute on all of the
configuration axes, so LabelListAttribute.Partition can be used to do
this based on a predicate function.

Test: go test ./bazel
Change-Id: I78ff8c24ce9c86bab5896290d8afe979d56545b6
2022-08-25 14:47:30 -04:00
Sam Delmerico
cc51843e52 add unit test for bp2build allowlist
Test: go test ./android
Change-Id: I0ea1d97444cbedfd285f1fc4bd7ff246ce699dc9
2022-04-14 13:31:09 +00:00
Liz Kammer
12615dbbca bp2build: support full/lite protos in cc libs
Test: bp2build.sh
Bug: 200601772
Change-Id: I3a7e00546726bc63b5eb8d5604557c5988a5320b
2021-12-02 11:00:46 -05:00
Jingwen Chen
9af49a49f8 Fix //conditions:default excludes computation for LabelListAttribute.
Previously, excludes computation for the default condition in label list
selects was clobbering pre-existing values. This CL fixes it by
performing a union of the new values with existing ones instead.

Test: properties_test.go
Bug: 198556411
Change-Id: Id11f4fb14e359201304afde0d8ba856851d41395
2021-11-03 01:56:42 +00:00
Liz Kammer
57e2e7a78f Refactor code for partitions c srcs
To support protos (and other srcs that generate sources), we need to
partition further. Separate out into a separate common function.

Bug: 200601772
Test: build/bazel/ci/bp2build.sh
Change-Id: I7bf4cd96fd9a9fca4ccb3c96f21a04303201f891
2021-09-23 18:28:24 -04:00
Liz Kammer
5fad501aeb bp2build: Split export_{includes,system_includes}
The specification of exporting includes vs system includes has an impact
on inclusion sort order. Conflating the two caused some symbols to not
be resolved correctly.

Bug: 198403271
Test: build/bazel/ci/bp2build.sh
Test: USE_BAZEL_ANALYSIS=1 m libbacktrace_no_dex succeeds with libc++_*
      modules removed from mixed build denylist (would fail otherwise)
Change-Id: I08aff253d8962dc678ed10214b1c171330e0fe19
2021-09-09 15:59:05 -04:00
Liz Kammer
74deed445b Extract function to handle configurable excludes
This allows it to be used for other modules types and other properties
(e.g. static_libs & exclude_static_libs).

Test: go test soong tests
Bug: 188497994
Change-Id: I40ab16e3b540ece0a6684558b32f7e8e25df6f24
2021-06-04 10:15:34 -04:00
Liz Kammer
9abd62d133 Use maps in bazel *attribute types
This is to simplify the process of resolving label + exclude labels
across the various configuration axes we have and across the various
properties/modules that use this behavior.

Test: ci/bp2build.sh && ci/mixed_droid.sh
Change-Id: I8efae3e75ddb365384f5caaf5bb504a5206618d3
2021-06-03 17:37:56 -04:00
Jingwen Chen
ed9c17d033 bp2build: refactor/standardize cc_* bp2build converters
This CL refactors the cc* bp2build converters to use the common
attribute extractors in cc/bp2build.go.

This also adds include_build_directory to be handled by the compiler
attr extractor to generate recursive headers as inputs.

This also turns include_dirs and local_include_dirs into the
execroot-relative -I flags.

e.g. if a module in  bionic/libc has "private" in local_include_dirs,
the "-Ibionic/libc/private" copt is generated for it.

Fixes: 185139955

Test: TH
Test: Forrest for mixed_clean-droid
Change-Id: Ib67056482227e62068fbbea0455035bdf5d56319
2021-04-22 08:31:24 +00:00
Rupert Shuttleworth
b815168474 Support arch variations for export_system_include_dirs in cc_library_headers bp2build converter.
Test: Added unit test
Test: bp2build-sync.py write; bazel build //bionic/... works for more cc_library_static targets (in a parent CL)
Change-Id: Ib487216a4bcbc52958ff948722dae347b0d8b606
2021-04-07 16:05:44 +00:00
Rupert Shuttleworth
2e4219be73 Add a way to remove duplicates from Bazel label lists, to e.g. avoid duplicate deps.
Test: Added unit tests, and also resolves bp2build error.
Change-Id: I6e01d9e233ec21dbb244e5682cbeebbc3a1ac0c4
2021-03-15 11:51:31 +00:00