Commit graph

17 commits

Author SHA1 Message Date
Zi Wang
7d54b3a5d8 Fix TestPrebuiltRootHostWithWildCardInSrc
Test: CI
Change-Id: Ia39ac3217fa827fec4c6e572e49c49c15e126109
2023-10-12 10:25:31 -07:00
Zi Wang
7c81b2b245 Merge "Support prebuilt_root_host in bp2build" into main 2023-10-12 17:10:21 +00:00
Zi Wang
040541496a Support prebuilt_root_host in bp2build
Also fix a bug that filename string may contain wild card

Test: Added unittest and CI

Bug: 303725325
Bug: 304590341
Change-Id: I5de9c195343328981a4154024c0fe4e14969ce79
2023-10-11 12:16:26 -07:00
Jingwen Chen
9c2e3ee54a Move platform constraints to bazel_common_rules.
This enables sharing of platform constraints between platform and kernel builds.

Bug: 304594734

Test: treehugger
Change-Id: I48091eeaf2e529c3f180ba056da3935911868b14
2023-10-11 12:07:44 +00:00
Liz Kammer
d5d12d028b bp2build: block src == name for prebuilt_* modules
src == name causes circular dependency errors, instead mark these as
unconverted and don't create modules for them.

Test: m bp2build and verify boringssl_self_test.zygote64.rc unconverted
Change-Id: I5d5fdd7e14830cd685816064cd0377998d07293c
2023-09-07 12:26:22 -04:00
Cole Faust
87c0c33a65 Make bp2build-generated selects() based on product config build settings
...instead of based on constraint settings.

Bug: 269577299
Test: m nothing and ./build/bazel/ci/bp2build.sh
Change-Id: Ib9caec79c92b8fd304e46be841de5612bd1637e3
2023-08-03 10:12:09 -07: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
Alix
993872a5d7 Handle filename variations for prebuilt_etc in bp2build
Bp2build now handles these cases:

-filename is specified as a property
-if filename is not specified and filename_from_src = true,
	filename is set as the src
-filename defaults to the module name otherwise

Bug: 228353188
Test: bp2build/prebuilt_etc_conversion_test.go
Change-Id: Ia4c9b2c89f100e4ed9363dc3ba20ea501b776216
2022-09-01 18:42:10 +00:00
Alix
e06d75be5d Exporting MakeBazelTarget() in testing.go
Since we are putting conversion tests in the same
package as the module being converted from now on

Test: m bp2build
Change-Id: Ied53589d497fef70bfa11d8f6067459c9a50cd72
2022-09-01 16:47:58 +00:00
Sam Delmerico
3177a6e1e0 export common bp2build testing functions
bp2buildTestCase
attrNameToString
runBp2BuildTestCase
makeBazelTargetNoRestrictions

The testing framework defined in the bp2build package can only be used
from within the package because many common testing functions are
private to the package. This prevents modules defined in Soong
plugins (e.g. system/tools/aidl/build) from testing bp2build conversions.

Test: go test ./bp2build
Change-Id: Ia867081327c5181d04687b13c4550e68e6a11f86
2022-08-01 14:49:31 -04:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
c78604e6a4 Use prebuilt_file for prebuilt_{etc,usr_share}
Bug: 215723302
Test: TestPrebuiltEtcNoSubdir
Test: bp2build.sh
Test: mixed_{libc,droid}.sh
Change-Id: I006bfe12beb770e11153c52eddf34a6ec7f9e363
2022-03-21 12:29:26 -04:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
b81f77ed24 Abstract prebuilt_etc into prebuilt_file
Bug: 215723302
Test: bp2build.sh
Test: mixed_{libc,droid}.sh
Change-Id: I0dab7a6209320e31cfdfe1ce28cacd4f37c11024
2022-03-21 11:21:59 -04:00
Chris Parsons
58852a05f3 Handle the 'enabled' property in bp2build
Also fix some bugs pertaining to configurable attribute handling of bool
attributes and label sttributes, so that they may support values across
multiple different axes at the same time.

Test: unit tests for bp2build
Test: mixed_droid

Change-Id: I411efcfddf02d55dbc0775962068a11348a8bb2c
2021-12-21 16:37:32 -05:00
Liz Kammer
be46fccc40 Use one mutator for all bp2build conversion.
Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.

Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
2021-12-14 09:37:45 -05:00
Liz Kammer
78cfdaa597 Refactor bp2build tests
Moves to specifying attributes as a map, such at it is possible to add
additional attributes conditionally. This is in particular useful once
supporting the `enabled` property which will add
`target_compatible_with`

Test: go test soong tests
Change-Id: Iade8eed1ce3acb1d1712a9ee3119d9ae59675624
2021-11-15 11:09:05 -05:00
Liz Kammer
dff00ea509 Handle arch-variant in prebuilt_etc
For cc_binary, changing the handling of version_script to no longer be a
LabelAttribute, which reduces test coverage of that type. Expand
prebuilt_etc to handle arch-variant srcs and correct a bug in
LabelAttribute.

Test: build/bazel/ci/bp2build.sh
Change-Id: I620bc3a43b28c1873f335e30099844ca79ce94c1
2021-10-04 13:44:34 -04:00
Rupert Shuttleworth
378fc1b410 Add initial bp2build convert for prebuilt_etc modules.
Test: Added unit test.

Change-Id: Ie63674e4a867e355e4667b4240979b822f0f3c86
2021-07-28 08:22:25 -04:00