aboutsummaryrefslogtreecommitdiff
path: root/bp2build/java_library_conversion_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Remove ConvertWithBp2build implementationsColin Cross2023-12-081-1131/+0
| | | | | | | | | Remove the ConvertWithBp2build implementations from all the module types, along with the related code. Bug: 315353489 Test: m blueprint_tests Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
* Shard Javacusta2023-10-181-0/+20
| | | | | | | | | Test: m nothing Test: allowlist frameworks/opt/calendar to bp2build convert Test: add `javac_shard_size: 2` to calendar-common Test: b //frameworks/opt/calendar:calendar-common Bug: 297356812 Change-Id: Ie22bcf04946f3945952a74a46772b777b1522b70
* Handle java_resources as depsLiz Kammer2023-10-121-3/+7
| | | | | Test: CI && unit tests Change-Id: I51f3c7d876c3cc25cb0459d933e1a510cfb5bf13
* Change openjdk9 specific props in bp2build/SoongLiz Kammer2023-10-121-0/+39
| | | | | | | | JDK17 is the default java version, adding these props conditionally openjdk9 is no longer relevant Test: CI Change-Id: I5d80fd22f474cedf389d1e295620cfc17bc327a0
* Move platform constraints to bazel_common_rules.Jingwen Chen2023-10-111-4/+4
| | | | | | | | | This enables sharing of platform constraints between platform and kernel builds. Bug: 304594734 Test: treehugger Change-Id: I48091eeaf2e529c3f180ba056da3935911868b14
* Use correct module name for java_import in shouldConvertWithBp2build ↵Zi Wang2023-10-091-0/+25
| | | | | | | | | | | | | | | verification This change makes sure that prebuilt module has correct module name prefix("prebuilt_") inside method shouldConvertWithBp2build, to avoid the bp2build conflict issue when a normal module and a prebuilt module with the same name are both allowlisted. Test: CI, added unit tests and the steps to reproduce in b/303376793 Bug: 303376793 Bug: 303868211 Change-Id: I4f1126182ec1f52ae6a08046a77204939230edef
* Test changes to prepare for allowlist v2Chris Parsons2023-10-051-1/+1
| | | | | | | | | | | | This implements a number of in-place unit test changes to prepare for some fundamental changes to bp2build ("allowlist v2"). This will change bp2build so that rdeps of unconverted or missing modules will not be converted by bp2build. Bug: 301312260 Test: Unit tests Test: Unit tests, with a local copy of allowlist v2 on Change-Id: I8c8c0a24ba173e213fffcb0f8d7e99845705f4a7
* Expand regex for likely aidl filegroupsLiz Kammer2023-09-291-1/+19
| | | | | Test: go test soong tests Change-Id: Iab7abea8e2d11583cb4a8ecd4b27368f61dd40e0
* Refactor bp2build tests for allowlist v2Chris Parsons2023-09-191-51/+13
| | | | | | | | | | | | | | | | | | Allowlist v2 will change bp2build by automatically disabling rdeps of unconvertible modules. Many bp2build tests create bp2build stub modules without an implementation, This CL changes setup of such tests to also contain a BUILD file with "stub implementations" of equivalent targets, to keep these test targets convertible. To verify this change in-place, this CL removes `bp2build_available: false` from these dependencies. This is a test-only change for bp2build tests. Bug: 285631638 Test: m bp2build Change-Id: I489480cbc4158a416b7abf57c35a6e2bc2ad6173
* Always drop deps from java_library with no srcsZi Wang2023-09-151-21/+24
| | | | | | | | | This is the follow up from aosp/2750763 Test: CI and added unit test Bug: 285952385 Change-Id: I64703ee4fa742b718ffb43f2af1b6ab43ddeb606
* export SimpleModuleDoNotConvertBp2build for AIDLSam Delmerico2023-09-101-3/+3
| | | | | Bug: 298246873 Change-Id: I06ed7bb8fc1139731a2b48440a91aeb7f383efff
* Do not convert resource dirs without resourcesLiz Kammer2023-09-081-3/+4
| | | | | | | | Previously we would convert to java_resources when there were no resources and get an error. Test: b build //external/libphonenumber/... --config=android Change-Id: I86f30b993a3ffdb20000f6a4c5261e2c4c74263c
* Do not convert java libraries with core_platformLiz Kammer2023-09-081-0/+11
| | | | | Test: go bp2build tests Change-Id: I2769c0d589c304caeb24a8ecba38a4a5ee6c63e5
* Add do not convert for sdk_version unsetLiz Kammer2023-08-291-107/+183
| | | | | | | | | | When sdk_version is unset, the build with fail with Bazel because private APIs are do not build with Bazel at this time. This instead prevents migrating the relevant target to Bazel in bp2build Test: go tests Change-Id: I31dabcf143de7933706d1b734ef21467a01b65e9
* support for multiple filegroups and resource_dirsAlix2023-08-251-4/+96
| | | | | | Test: tests in bp2build and b build //external/emma:emma Change-Id: I57e60389aec926c55d01818a6a3b1ec33e9c53b8
* Bp2build for errorprone modules that manually enabled/disabled itAlix2023-07-131-8/+20
| | | | | Test: go test ./bp2build Change-Id: Ie60c0959ee9ae8ce86c11a8e85a0bc7592f63df8
* bp2build java_resources that only contain a filegroupAlix2023-05-241-0/+40
| | | | | | | | supports filegroup that specifies path property Bug: 280860624 Test: built libauto_value_plugin Change-Id: I9ed0b13e055beb92ba8090f6b5e88b9873c9ce61
* Provide a resource_prefix_strip for java_resources in bp2build.Romain Jobredeaux2023-05-041-6/+10
| | | | | | | | | | | | | Although paths to resource files in a Bazel java_library should be relative to the package, the directory structure in the resulting jar will have resources under the full path from the top-level of the workspace, e.g. if a library in "a/BUILD" has java_resouces as "res/res.txt" then by default the res.txt file would appear under "a/res/res.txt". Fix this by adding a resource_strip_prefix in that case. Test: Unit tests Change-Id: If4325126f5c19a2a8fb83ee09bc3a95a18673fe3
* Bp2build support for sdk_version and java_version.Romain Jobredeaux2023-04-111-3/+6
| | | | | | | | | | | | | | | | | | This CL adds java_version and sdk_version support to bp2build converters for - java library - java binary - android library - android binary - android library import Although java import doesn't support java_version and sdk_version, the neverlink java_library wrapper around a java_import must specify a sdk_version when targetting a device. "none" is used by convention. Change-Id: I22a69dea2e351858368df69ed6a703b568d613ea Bug: 215230098 Test: Presubmits
* Support arch variants in java's StaticLibs in bp2buildRomain Jobredeaux2023-04-041-2/+16
| | | | | | Test: Presubmits Bug: 276901800 Change-Id: I6058a726833ef10a5f470946e2d265b20fa547ce
* Add apex_available aidl + aidl&lang librariesLiz Kammer2023-03-241-0/+1
| | | | | Test: b build com.android.neuralnetworks com.android.media.swcodec Change-Id: I008b915b22e4c8c2cf1f0aee6cfdaf17374cb3a9
* bp2build kotlinCFlagsAlix2023-03-141-2/+25
| | | | | | | | for java_library, java_binary, android_app & android_library Change-Id: Ia8dec7e7d497eb41b2d8dcd8c44c3090d1d3b4bd Bug: 271265771 Test: go test ./bp2build
* Call ResolveExcludes after arch-based sources computation in java.goRomain Jobredeaux2023-03-081-0/+26
| | | | | TEST: go test Change-Id: I93a8ae5e0842dab03f73b0edb32841755d2ea435
* arch variant support for libs propertyAlix2023-01-191-0/+40
| | | | | | Test: bp2build tests and manually inspected Build file for libprotobuf-java-lite Bug: 244210934 Change-Id: Id60d859eea2c23fa7a29784faeed5cb050d4193e
* Merge "support libs for android_library"Treehugger Robot2023-01-061-0/+3
|\
| * support libs for android_libraryAlix2023-01-051-0/+3
| | | | | | | | | | | | | | adds support for *-> android_library and android_library->* edges Change-Id: I41d4e1d1b8106a17e67951d47e67b59ef3170d17 Test: manually inspected build files for libWallpaperPicker & android-suppor-v4
* | Libs support for * -> java_library_edge with kt sourcesAlix2022-12-151-0/+2
|/ | | | | | Bug: 244210934 Test: bo2build tests and built kotlinx_atomicfu Change-Id: Id6eac2f104878e4d7902a32e846ef1cc87dd7863
* Bp2Build for libs property in java_libraryAlix2022-11-291-2/+20
| | | | | | | | Bp2build for both *->java_library and java_library->* edges. Change-Id: I2540c9af2ae2fe7677767d507647b1c6669b9bb7 Bug: 244210934 Test: ./bp2build testcase, manually inspected build files for hamcrest-library, hamcrest targets
* bp2build for java_library with .kt srcs or common_srcsAlix2022-11-151-0/+43
| | | | | | | | | java_library modules with .kt srcs or common_srcs will be converted into module type kt_jvm_library Test: m bp2build, manually inspected build files for allowlisted modules Bug: 258688914 Change-Id: I8293a11c8247b4b76358d0991f82c6b61b58adc3
* Support arch features in bp2buildCole Faust2022-09-021-0/+115
| | | | | | Bug: 189972518 Test: New soong test Change-Id: I05d77c8f63ffe6697d8e0300226864658055e116
* Exporting MakeBazelTarget() in testing.goAlix2022-09-011-25/+25
| | | | | | | | Since we are putting conversion tests in the same package as the module being converted from now on Test: m bp2build Change-Id: Ied53589d497fef70bfa11d8f6067459c9a50cd72
* non-adjacent AIDL filegroup bp2build test javaSam Delmerico2022-08-251-0/+33
| | | | | | | | Add test to ensure that filegroups from other packages are correctly added as dependencies for java_library. Test copied from aosp/2183478. Test: go test ./bp2build Change-Id: Ie39b7182f544fa196870fb7311817e6b6e68817b
* convert .aidl srcs for java_librarySam Delmerico2022-08-251-0/+129
| | | | | | | | | 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
* export common bp2build testing functionsSam Delmerico2022-08-011-76/+76
| | | | | | | | | | | | | | | 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
* convert java_resources with bp2buildSam Delmerico2022-05-101-0/+105
| | | | | | Test: b build --platforms=//build/bazel/platforms:linux_x86 //external/jarjar:jarjar-binary and try to use on a jar Change-Id: Id6f4e6937687fd575360fbacaeda55c41922636e
* bp2build converts java_version property to javacopts attributeVinh Tran2022-04-281-0/+16
| | | | | | | | | | 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
* convert logtags in java srcsSam Delmerico2022-04-081-0/+32
| | | | | | | | 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
* support errorprone javacflagsSam Delmerico2022-03-311-0/+63
| | | | | | | | 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
* add plugins to javaLibraryAttributesSam Delmerico2022-03-301-2/+29
| | | | | Test: go test ./bp2build Change-Id: I8e4c3f373c62c60ea5013cd8c585915a366c1f81
* emulate java_library static_deps with Bazel exportsSam Delmerico2022-03-301-0/+74
| | | | | | | | | | | | | | | | | | 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
* Add the initial implementation of bp2build converter for java_library,Wei Li2021-12-141-0/+57
java_library_host, java_binary_host and cc_library_host_shared so signapk tool can be built with Bazel. Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal Test: jarsigner -verify -verbose build.bazel.examples.apex.minimal.apex Bug: 209876137 Bug: 196204358 Bug: 210158864 Bug: 210159074 Bug: 210158872 Change-Id: I855884159d25e69d8f9623792c376da820a1eb4c