Commit graph

433 commits

Author SHA1 Message Date
Sam Delmerico
1fa2672be9 add bp2build unit tests for aidl_interface
Bug: 229251008
Test: go test ./bp2build -run TestAidlInterface
Change-Id: Ie7214d5578bc21e348410ca91ea42d7a3190eb3d
2022-08-25 14:47:41 -04:00
Sam Delmerico
97bd127457 convert .aidl srcs for java_library
Test: go test ./bp2build
Test: b build //frameworks/base/services/tests/servicestests/aidl:servicestests-aidl
Test: enable //packages/modules/NetworkStack/common/networkstackclient
    && disable restriction on Android SDK in javaLibraryBp2Build
    && b build //packages/modules/NetworkStack/common/networkstackclient:ipmemorystore-aidl-interfaces-V10-java
Change-Id: Ifb817daf09a3983ea1c84948ed9f02a79f95784b
2022-08-25 14:47:41 -04:00
Trevor Radcliffe
218dae74b1 Merge "Reexport whole_static_libs in cc_library_headers" 2022-08-22 20:39:08 +00:00
Vinh Tran
88b3ba2ae2 Merge "Convert filegroup with AIDL srcs to aidl_library" 2022-08-19 20:36:10 +00:00
Cole Faust
370b37e053 Merge "Bp2build support for runtime_libs" 2022-08-19 20:09:56 +00:00
Vinh Tran
444154d5d3 Convert filegroup with AIDL srcs to aidl_library
Change-Id: I94c185744a86c812dc48e30b66e060361b9161cb
Test: USE_BAZEL_ANALYSIS=1 m libbinder
Test: USE_BAZEL_ANALYSIS=1 m module-lib-api-stubs-docs-non-updatable
Bug: 243010121
2022-08-18 14:01:15 -04:00
Trevor Radcliffe
7f897fcef0 Reexport whole_static_libs in cc_library_headers
Fixes: 236268577
Test: Unit Tests
Change-Id: I3a13f850d1d593b90c79f668f1eaf5be0035db1f
2022-08-18 15:53:00 +00:00
Cole Faust
6b29f593ea Bp2build support for runtime_libs
Bug: 213201180
Test: Updated the minimal apex in the build/bazel cl to include runtime_libs so the apex diff test will test it
Change-Id: I10add1895cfa122a370d24196a33ec2dcfafccfc
2022-08-17 15:20:17 -07:00
Colin Cross
d079e0b270 Reformat build/soong for go 1.19
Test: none
Change-Id: I132368f0fcbdb5ea088b5b84dbe4ccfdd9e94cad
2022-08-17 10:43:13 -07:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
3a019a635a Add StringAttribute for bp2building
Instead of a StringListAttribute of length 1,
introduce a more appropriately reduced StringAttribute
so that e.g. `select`s work properly

Test: new cases in TestGenerateBazelTargetModules
Change-Id: I0ae0e4a51e39f85caf55b0d00459222ede6de79c
2022-08-15 22:59:56 +00:00
Yu Liu
5d866ed81a Move testing.go to srcs from testSrcs.
This is needed so that tests in other packages can depend on it.

Bug: 232520859
Test: Manually run m nothing to verify that all tests passed
Change-Id: Ief64e8d0e4030431b26cb5526c9f8beab94cad23
2022-08-11 13:00:00 -07:00
Romain Jobredeaux
aaf4f5ec8a Merge "Bp2Build converter for android_library_import and android_library." 2022-08-09 17:46:59 +00:00
Treehugger Robot
68572c83bf Merge "update bp2build tests for cc_yasm + add to CI" 2022-08-09 01:49:37 +00:00
Romain Jobredeaux
c9b2bba3cd Bp2Build converter for android_library_import and android_library.
Minor refactor of android_app converted to account for common attributes
between library and app.

Test: go test
Test: ../bazel/ci/bp2build.sh
Change-Id: I60b06eef6d2b9bc2d91f8b83522747ebbe76bbb6
Bug: 215230093
Bug: 215230095
2022-08-08 11:23:02 -04:00
Sam Delmerico
c9a49dff90 update bp2build tests for cc_yasm + add to CI
This test got missed in the change to export the bp2build testing
functionality because it wasn't listed in the Android.bp file to be run
as tests in CI.

Test: go test ./bp2build
Change-Id: Ic8f16bb0d5d75084592caa4ea3018384c1c7a30c
2022-08-08 10:52:27 -04:00
Sasha Smundak
f2bb26f492 Show module's type and path when reporting dependency problems
Test: treehugger
Change-Id: I25c3eddbeeb10bd6b9bfa9e869f6fbc98d2a6ec4
2022-08-04 14:49:25 -07:00
Liz Kammer
3a0355f99c Merge "export common bp2build testing functions" 2022-08-04 18:11:16 +00:00
Cole Faust
7071a05c93 bp2build support for .asm files
Bug: 233948256
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I387c2aeb36df004f0e1838a08a4f28b38503d6ed
2022-08-03 13:34:15 -07:00
Usta Shrestha
b7e4b08e46 Merge "Cosmetic Changes plus log errors" 2022-08-02 21:33:51 +00:00
Usta Shrestha
db46a9bbb8 Cosmetic Changes plus log errors
Test: N/A
Bug: N/A
Change-Id: I39e622a93270c922bdbea27ca79632a606431a2c
2022-08-02 20:24:57 +00:00
Jingwen Chen
7810e17e54 Export default apex version from updatable_modules.go to Bazel's
apex_toolchain through soong_injection.

This is necessary to keep both Bazel and Soong in sync.

Test: presubmit
Bug: 238723069
Fixes: 238153998

Change-Id: Ibf4a8ed91d358dc7800c10e4112485a52f0606bb
2022-08-02 10:11:36 +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
Alix Espino
2f384a7432 Merge "Implement bp2build for linker_config" 2022-07-29 18:19:00 +00:00
Alix
1be00d4e48 filter unknown clang cflags in bp2build
filtering out no longer useful flags in bp2build conversion

Test: cc_library_shared_conversion_test
Bug: 231995978
Change-Id: I5172f6d07a8928291bbc11bd8802678b33cc5b1f
2022-07-29 12:17:25 +00:00
Sasha Smundak
0fd93e0756 Output informational messages only when BP2BUILD_VERBOSE is set.
Test: manual
Change-Id: Ieeb00a002e07b04449d70614ce205c47c1dd7bce
2022-07-18 13:34:44 -07:00
Liz Kammer
45faf8f427 Implement bp2build for linker_config
Pair: agespino
Bug: 211666695
Test: TODO
Change-Id: I479bcd7c53b1c57563fb4277ec39ad70b16030b8
2022-07-08 16:09:40 +00:00
Treehugger Robot
281d421f41 Merge "Remove alternative stl names in bp2build" 2022-07-01 14:54:20 +00:00
Trevor Radcliffe
130d98f8b2 Merge "Add support and tests for export_*_lib_headers" 2022-06-30 17:30:16 +00:00
Trevor Radcliffe
2be7f54b45 Add support and tests for export_*_lib_headers
There are 3 different properties about exporting headers in Soong:

1. export_static_lib_headers
2. export_shared_lib_headers
3. export_header_lib_headers

The static and header cases are already supported in bp2build but
do not have tests. This CL adds support for the shared case and
adds tests for all cases.

Fixes: 236268577
Test: Unit tests
Change-Id: Idfb788271e607919d4ac6bc0e4eb4e6ff8f78e8d
2022-06-29 15:25:01 +00:00
Liz Kammer
7128d38da5 Remove alternative stl names in bp2build
Test: bp2build.sh
Change-Id: Ie2bdac79306f9a5b50331f808f00187e172e46ab
2022-06-27 17:20:17 -04:00
Colin Cross
2bce04f76f Merge "Add linux_musl arm+arm64" 2022-06-27 18:37:07 +00:00
Colin Cross
a9b2aacf07 Add linux_musl arm+arm64
Add toolchains to support cross compiling to aarch64-linux-musl and
arm-linux-musleabihf.

Bug: 236052820
Test: build arm and arm64 musl sysroots
Change-Id: I47a9322929baff2492c6e8db989ece01fcbeb133
2022-06-24 13:46:36 -07:00
Trevor Radcliffe
fb6c522420 Remove implementation_deps from cc_library headers
Don't add implementation_deps to cc_library_headers in bp2build

Fixes: 236404654
Test: unit tests, USE_MIXED_BUILDS=1 m
Change-Id: I0f6a35c10284f261b6a8b7a4831655d5fa084977
2022-06-21 22:34:11 +00:00
Yu Liu
57c1edc4d9 Merge "Support cc code coverage for mixed build" 2022-06-13 18:57:50 +00:00
Treehugger Robot
ab12f792c0 Merge "Allowlist apexer for bp2build" 2022-06-13 00:05:53 +00:00
Jingwen Chen
b732d7c765 bp2build: convert apex.logging_parent.
Test: CI
Fixes: 235559958

Change-Id: I7b578c67eedb0379603bcf2fc029d03facfbbb0f
2022-06-10 08:38:03 +00:00
Cole Faust
01243368d7 Allowlist apexer for bp2build
This also introduces a workaround for the fact that
apexer depends on aapt2, but aapt2 doesn't build
with bp2build yet. Aapt2 is removed from apexer's
requirements during bp2build.

Bug: 204244290
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I837597ce035c7d5c06e1a3957166583a7a94b5c7
2022-06-09 13:28:25 -07:00
Jingwen Chen
1f0b70e7c0 Merge changes Ib9a08167,I925e98d5
* changes:
  Use prebuilt_etc for prebuilt modules in bp2build test, instead of pretending with a cc_library.
  Only override prebuilts property if the override_apex.prebuilts is explicitly specified (not nil).
2022-06-09 06:50:00 +00:00
Jingwen Chen
81c67d3904 Use prebuilt_etc for prebuilt modules in bp2build test, instead of
pretending with a cc_library.

Test: CI
Change-Id: Ib9a081670e072a0e7378289f677063a978d0a62d
2022-06-08 16:10:19 +00:00
Jingwen Chen
df165c9e85 Only override prebuilts property if the override_apex.prebuilts is
explicitly specified (not nil).

This allows the base apex's prebuilts to be surfaced to the override
apex target.

Discovered when com.google.android.adbd's prebuilts didn't contain its
init.rc module.

Bug: 222588072
Test: CI
Change-Id: I925e98d53f7d9208652c629799ab568521ba7dfe
2022-06-08 16:03:03 +00:00
Jingwen Chen
fb237088e3 Actually run gensrcs_conversion_test.
And fix expected bazel target generation -- makeBazelTarget generates a
target_compatible_with, which is not in the expected attrs, causing
tests to fail.

Test: CI
Change-Id: Iddb9b6a7edf99d1f11043b4e77fdd3f256f3d7f2
2022-06-08 14:57:04 +00:00
Yu Liu
8d82ac58b4 Support cc code coverage for mixed build
Bug: 231322627
Test: Manual tests and unit tests
Change-Id: I786042af0d612192c54c3572f63a86a47174a242
2022-06-06 12:29:25 -07:00
Treehugger Robot
335071dad2 Merge "Convert override_apex.package_name with bp2build." 2022-06-06 14:59:07 +00:00
Liz Kammer
ace70d857e Merge "Do not hardcode default/experimental c{pp}std" 2022-06-06 13:40:17 +00:00
Jingwen Chen
9b7ebca187 Convert override_apex.package_name with bp2build.
Bug: 216414792
Test: CI and new bazel/bp2build tests
Change-Id: I3974970cdd555b3912798e79e61d61786a4ff677
2022-06-06 10:08:53 +00:00
Liz Kammer
62ac8a0707 Merge "Handle restricting to device only builds" 2022-06-02 20:29:27 +00:00
Vinh Tran
b69e1aec66 Modify ConvertWithBp2build mutator to convert gensrcs to Bazel rule
Test: b build --platforms=//build/bazel/platforms:linux_x86
//art/runtime:art_operator_src

Change-Id: I942d68e17968327cc77f379edce9b73416e6c4fd
2022-06-01 16:00:28 -04:00
Liz Kammer
dfeb120324 Handle restricting to device only builds
By default, most module types are only enabled for device. Converting
this behavior and host_supported/device_supported properties allows us
to skip building incompatible targets.

Test: soong tests
Test: bp2build.sh
Change-Id: If1da523b4cc8c4cbf2bb26da063d9923b662cc32
2022-05-31 17:46:48 -04:00
Liz Kammer
a5a29de677 Do not hardcode default/experimental c{pp}std
Prevent bugs like b/232866078 by using the same values across Bazel and
Soong

Test: bp2build.sh
Change-Id: If257f9f5f8e8a70bbf3a8cf5479758c703c25c3f
2022-05-27 09:38:03 -04:00
Cole Faust
53b62098d0 Add bp2build converter for python protobuf files
Bug: 196084681
Test: b run //build/bazel/examples/python/protobuf:build_bazel_examples_python_protobuf_main --config=linux_x86_64
Change-Id: I4d806902d262351231f64686a5d24513a25d9749
2022-05-26 15:54:23 -07:00
Trevor Radcliffe
ef9c900ec3 Generate genlex rules from bp2build for cc targets
This change will cause bp2build to generate genlex targets any
time a .l or .ll file is present in the srcs for a cc target and
add those genlex targets to the srcs attribute of the original
target.

Bug: 207408632
Test: unit tests
Change-Id: I1bce82c9d3c3d458eae1cef547ffae3d6e975134
2022-05-24 14:42:51 +00:00
Wei Li
40f9873612 Convert the property "manifest" properly for override_apex.
1) When it is not set in base apex, default file name should be set explicitly in bp2build converter of apex
2) The manifest file path should be used as-is when base apex and override_apex is in the same Android.bp
3) The manifest file path should be prepended with package of base apex when base apex and override_apex is in different Android.bp

Bug: 216442475
Test: m nothing
Change-Id: Icd3523ebc31d885f67bea02aec05dbfc77671e87
2022-05-23 17:22:35 -07:00
Cole Faust
bd4c14a7f9 Merge "Add imports property to py_library rules" 2022-05-23 18:55:51 +00:00
Jingwen Chen
d9d096ec7c queryview: don't generate 'for' attributes
'for' is a reserved keyword

Test: CI
Fixes: b/233579439
Change-Id: I7b94250574465353bbd6bfb82a7ea37ce9ae17a3
2022-05-23 09:38:39 +00:00
Cole Faust
b09da7e863 Add imports property to py_library rules
This is to avoid having it hardcoded in a fork of the
py_library rule.

Most import attributes should just be set to ".", but
our previous solution always hardcoded it to ".." instead,
for ndkstubgen. ndkstubgen uses pkg_path: "ndkstubgen",
i.e., it set pkg_path to the name of the folder that
contained the Android.bp file. In this specific scenario,
imports = ".." works. Recreate that behavior here as well,
because we don't handle pkg_path properly yet.

Fixes: 233081071
Test: build/bazel/ci/bp2build.sh
Change-Id: Ib5e6a8edf428c74d4b5947f0ec53a2151001367a
2022-05-19 12:38:27 -07:00
Treehugger Robot
478db1a882 Merge "bp2build: add support for planting unresolved symlinks in the symlink forest." 2022-05-17 19:39:42 +00:00
Jingwen Chen
d4b1dc8b2a bp2build: add support for planting unresolved symlinks in the symlink forest.
In the isDir check, there's a possibility that the Stat check fails
because the path is an unresolved symlink. Verify it with Lstat (which
would succeed, since it doesn't follow links), and treat it like a file
if Lstat succeeds.

Test: new integration test
Fixes: 232370097
Change-Id: I9807ca363a5dbdc20639b489b54627bd2cc1ca60
2022-05-17 12:17:53 +00:00
Elliott Hughes
6741d0eaa9 Now gnu11 is the default, bump experimental to gnu17.
Bug: http://b/232413369
Test: treehugger
Change-Id: I8a2b1eef744c219811c32ad46688437a1ba3f21e
2022-05-12 09:53:11 -07:00
Wei Li
49611b39a9 Merge "Add bp2build converter for override_apex." 2022-05-12 07:22:52 +00:00
Wei Li
1c66fc74d2 Add bp2build converter for override_apex.
Bug: 216442475
Test: m nothing
Change-Id: I2f106d15c1d235583b8b1a8f0ac4b48162ff4fdd
2022-05-11 22:22:04 -07:00
Sam Delmerico
79985819fe convert java_resources with bp2build
Test: b build --platforms=//build/bazel/platforms:linux_x86
  //external/jarjar:jarjar-binary and try to use on a jar
Change-Id: Id6f4e6937687fd575360fbacaeda55c41922636e
2022-05-10 14:32:52 +00:00
Lukacs T. Berki
e3487c8848 Add a test for correctness of C++ compilation.
This required the following:

- Adding Platform_base_sdk_extension_version to default soong.variables
- Teaching the symlink tree creation code to understand symlinks
- Making finder.go follow symlinks when requested

Adding yet another knob is unfortunate, but I can't allow that
unconditionally because the Android code base contains a number of
symlinks giving rise to infinite directory trees because they point back
to their parent and this seemed preferable to adding complicated logic
like "follow symlink but if only its fully resolved version does not
point under the source tree".

I could be convinced about the latter, though.

Test: Presubmits.
Change-Id: I453f6b7e5334771f5832c700db00f9d24ed1d82f
2022-05-04 09:12:01 +02:00
Vinh Tran
3ac6daf47c bp2build converts java_version property to javacopts attribute
This CL also converts `external/rappor` (which already set `java_version` to `1.7`) to be bazelable to testify the changes.

Results from `b build //external/rappor && cat bazel-bin/external/rappor/librappor.jar-0.params`: https://paste.googleplex.com/5518725462622208.

Test: go test ./bp2build/...
Bug: 227618664
Change-Id: I8d370d4639f70fba51e6de6ceb7bcb5ace9ccd91
2022-04-28 18:52:48 -04:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
126bd58e72 Handle cc_defaults' shared for cc_library_shared
Akin to testing for cc_defaults' `static`, we introduce
a `shared` sibling to
TestStaticLibrary_SystemSharedLibsStaticEmpty

Bug: 195451854
Test: TestCcLibrarySharedSystemSharedLibsSharedEmpty
Change-Id: I63cb0641d216e8c11586ecf415fa2441e31dd3e5
2022-04-25 17:24:33 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
66e6466e0f Merge changes from topic "b/215723302"
* changes:
  Use prebuilt_file for prebuilt_{etc,usr_share}
  Abstract prebuilt_etc into prebuilt_file
2022-04-21 14:37:46 +00:00
Trevor Radcliffe
2e7c82ea0b Merge "Fix tests for cc_prebuilt_library bp2build" 2022-04-20 14:16:44 +00:00
Trevor Radcliffe
54abd2e128 Fix tests for cc_prebuilt_library bp2build
Also, add the tests to Soong

Bug: 225938765
Test: ran tests
Change-Id: Ia26e46d89b8a408eb4b09f93a7ed4f0aa2e37809
2022-04-19 14:54:00 +00:00
Yu Liu
d683fc45a3 Merge "Support use_version_lib in cc_binary." 2022-04-18 19:10:42 +00:00
Yu Liu
a79c946fb0 Support use_version_lib in cc_binary.
Bug: 208481704
Test: Add unit test
Change-Id: I7cf299dd6b3287974067234687b3b2495a85d31e
2022-04-15 15:45:06 -07:00
Trevor Radcliffe
58ea451750 bp2build support for cc_prebuilt_library
while cc_prebuilt_library_(shared|static) were already supported,
the raw cc_prebuilt_library module type was not supported by
bp2build. This CL provides that functionality.

Also did a little bit of refactoring and cleaning.

Bug: 225938765
Test: Confirm output BUILD.bazel files look as expected. Confirm
      that build succeeds.
Change-Id: Ic004f88febc0e5b527f2ef420dbd96ecc55d2e09
2022-04-15 16:29:28 +00:00
Sam Delmerico
24c5603815 refactor bp2build module allowlists into struct
To make testing easier, refactor existing module-global variables into a
struct that can be mocked.

Test: build/bazel/bp2build.go
Change-Id: I9d177677644ea743641a745b1839a3a8b29f902a
2022-04-14 13:31:05 +00:00
Treehugger Robot
b6e1614272 Merge "convert logtags in java srcs" 2022-04-08 22:37:22 +00:00
Treehugger Robot
a2a7b57924 Merge changes from topic "export-vars"
* changes:
  export Java variables to Bazel
  refactor Bazel variable export
2022-04-08 17:31:23 +00:00
Sam Delmerico
24da73c032 convert logtags in java srcs
Some java_* modules contain .logtag files in their srcs, but we should
separate these out into their own targets.

Test: enabled QuickSearchBox and build
Change-Id: I595722ca59686d450ff522987a15ce283d3607e0
2022-04-08 14:43:18 +00:00
Sam Delmerico
932c01cf9e export Java variables to Bazel
Test: build/bazel/bp2build.sh
Change-Id: Ia06f9265c9f96e6add6edbd0cee925fe37b430d3
2022-04-08 14:15:43 +00:00
Treehugger Robot
ef03b3d8ba Merge "support errorprone javacflags" 2022-04-05 17:46:08 +00:00
Sam Delmerico
489831660c convert java_import jars with arch variants
Bug: 220168131
Test: go test ./bp2build -run TestJavaImport
Test: b build '...'
Change-Id: Ib485e6905e7be9d199af5295b23131c226fd6e96
2022-03-31 21:00:24 +00:00
Sam Delmerico
58614c0414 support errorprone javacflags
Soong has a separate property specifically for errorprone javacflags
that we need to add to the Bazel javacopts.

Test: go test ./bp2build
Change-Id: I5299f45793d2b05a6a71b94dd17ceb797f407846
2022-03-31 14:38:07 +00:00
Sam Delmerico
3c25ab1ac3 Merge changes I8e4c3f37,I89a32bde
* changes:
  add plugins to javaLibraryAttributes
  convert java_import_host with bp2build; enable jetifier
2022-03-30 21:08:12 +00:00
Treehugger Robot
d93afba1e6 Merge changes from topic "no-srcs-no-deps"
* changes:
  enable conversion of all java_import modules
  emulate java_library static_deps with Bazel exports
2022-03-30 21:06:46 +00:00
Sam Delmerico
77267c7d9c add plugins to javaLibraryAttributes
Test: go test ./bp2build
Change-Id: I8e4c3f373c62c60ea5013cd8c585915a366c1f81
2022-03-30 19:19:13 +00:00
Sam Delmerico
c016143602 emulate java_library static_deps with Bazel exports
In Soong, java_library can specify static_deps which are dependencies
that get aggregated into the final jar (akin to static linking). This is
useful because it allows dependencies higher up in the chain to compile
against the APIs exported by transitive dependencies. Bazel does not
support this functionality directly, but it can be emulated via the
exports attribute which makes any targets listed in the attribute public
to targets further up the chain.

Bug: 217236083
Bug: 219908977
Test: b build //external/error_prone:error_prone_core
Test: b build //external/bouncycastle:bouncycastle-host
Test: b build --platforms=//build/bazel/platforms:linux_x86
  //prebuilts/sdk/tools/jetifier/jetifier-standalone:jetifier
Change-Id: I2867e3f816de720a6f4bd9ff7a847d1b0c2da2d6
2022-03-30 18:58:38 +00:00
Treehugger Robot
6876d5aa5f Merge "Dedupe libraries in both static and whole static" 2022-03-26 00:32:01 +00:00
Treehugger Robot
1c2d87ba83 Merge "Add metrics collection to soong_build" 2022-03-26 00:21:21 +00:00
Chris Parsons
715b08fd82 Add metrics collection to soong_build
Metrics are added to a materialized protobuf soong_build_metrics.pb

Recorded events have scoped names and recorded runtimes.
For example, mixedbuilds includes the following events:

mixedbuilds.prepare
mixedbuilds.analyze.write_files
mixedbuild     (this is a total of all mixedbuild events)

Test: Manually verified materialized protos for mixedbuild, bp2build,
and legacy build.

Change-Id: I2e72d4502c0373bee0279bb1320b2e4dd586129c
2022-03-25 17:19:44 -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
Liz Kammer
cc2c1efc9a Dedupe libraries in both static and whole static
In Soong, libraries can appear in both static and whole static libs;
however, in Bazel, this results in errors due to duplicate libraries.

Test: bp2build.sh
Change-Id: I9dda4f7a7812340d28a6160d0e25f421c9db6612
2022-03-21 09:03:29 -04:00
Yu Liu
fc603167f4 Support tailoring clang --target flag based on min sdk version.
Bug: 215748260
Test: Tested using aquery to verify the --target flag; add added unit

Change-Id: Ifb13509db7d1e110316aa44d55ec9cccaa4b83d1
2022-03-18 01:16:52 +00:00
Treehugger Robot
7db79508c7 Merge "bp2build supports arch variant srcs for java_library" 2022-03-14 17:06:01 +00:00
Treehugger Robot
b3bdf38453 Merge changes Ic3ef7557,If75daf11
* changes:
  add all existing bp2build tests to CI
  remove unconverted strip_import_prefix property
2022-03-07 20:50:21 +00:00
Sam Delmerico
d3a1cfa6d1 add all existing bp2build tests to CI
Test: go test ./bp2build
Change-Id: Ic3ef75573cda9ed10c74bf12860269922e197d60
2022-03-07 18:26:33 +00:00
Sam Delmerico
7a62909f35 remove unconverted strip_import_prefix property
The requirements for this property changed in aosp/1985613.

Test: go test ./bp2build
Change-Id: If75daf11c857cdd8a54c119e073e327cddf8543d
2022-03-07 16:28:50 +00:00
Sam Delmerico
e91d0303f2 bp2build supports arch variant srcs for java_library
Bug: 209577426
Test: build/bazel/ci/bp2build.sh
Change-Id: I6799bda904d286616e580f2395601ce4f764180f
2022-03-07 16:15:56 +00:00
Sam Delmerico
881d72022a bp2build java_libraries depend on Android SDK
Soong adds an implicit dependency on the Android SDK for all
java_libraries (and related modules). This feature becomes apparent
after converting arch-variant srcs for android_apps, so we should suport
this for now. Eventually, we will want to replace this forced dependency
with a Bazel toolchain workaround.

Test: build/bazel/ci/bp2build.sh
Change-Id: Ic28e8c7690f69294b4bdcb9bb78a6f1f031fe97e
2022-03-07 15:50:42 +00:00
Liz Kammer
e8303bd0ae Export variant/features via soong_injection
Test: build/bazel/ci/bp2build.sh
Change-Id: If70043dc9d020d5f4a243ba4b192b99c9c7e8563
2022-02-28 14:17:15 -05:00
Sam Delmerico
c768102bce convert java proto libraries with bp2build
Allow java_libraries that depend on protobufs to be converted with
bp2build.

Bug: 215230097
Test: build/bazel/ci/bp2build.sh
Change-Id: I3ce52389e7e4e82755605ee277c1e527a6aebc6b
2022-02-15 21:04:59 +00:00
Liz Kammer
7756c8f20e Correct bp2build canonical_from_root logic
The logic was inverted from what it should have been,
canonical_from_root --> no strip_import_prefix attribute.

Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_droid.sh
Change-Id: Ic6685d8f0b88279d4444bab3b5e03a544d225f77
2022-02-15 09:54:57 -05:00
Treehugger Robot
9deb87e8e2 Merge "Escape cc ldflags in bp2build conversion" 2022-02-09 23:05:01 +00:00
Treehugger Robot
5974423b06 Merge "Add package for printing starlark formatted data" 2022-02-09 04:48:33 +00:00