summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2023-06-01Merge "Add simple bp2build converter for java_test_host" Zi Wang
2023-06-01bp2build for java libraries using xsd_config srcs Spandan Das
In Soong, java libraries can use src files generated from xsd_config. In Bazel, instead of providing srcs, java_xsd_config_library will provide a jar. Update bp2build so that all src references to xsd_config modules in srcs get routed to deps and exports attributes This CL creates an interface in build/soong/android to get around a circular dependency issue. The bp2build logic needs to exist in soong-java, but soong-java does have soong-xsdc in its package path. Use the interface and type assertions to special case xsd_config references Bug: 211678537 Test: bp2build test in sibling CL in system/tools/xsdc Change-Id: Ida924bb20b1fd7eb8beeef950b070d37a9c6f3b5
2023-06-01Explicitly specify `--api-overloaded-method-order source` for metalava Paul Duffin
Previously, `--api-overloaded-method-order source` was the default if that option was not specified but the other change in this topic is switching it to `--api-overloaded-method-order signature` to match the behavior in AndroidX. This change explicitly specifies the option needed by Soong's use of metalava. Bug: 285140653 Test: m checkapi Change-Id: I00e049e0d991e650ab9940a3d495ed2b6e7480f8
2023-06-01Add simple bp2build converter for java_test_host Zi Wang
Bug:281551424 Test: java_test_host_conversion_test.go and presubmits Change-Id: I43ed26df0bacd63ef402de4d9733d19604005c35
2023-06-01Explicitly specify `--api-class-resolution api` for metalava Paul Duffin
Previously, `--api-class-resolution api` was the default if that option was not specified but the other change in this topic is switching it to `--api-class-resolution api:classpath` to match the behavior in AndroidX. This change explicitly specifies the option needed by Soong's use of metalava. Bug: 285140653 Test: m checkapi Change-Id: Ief3c7f9dfdfa946f21cb048a579ec90309fb350f
2023-05-26Support test runnner option in auto generated test configs Dan Shi
Bug: 284179405 Bug: 236980335 Test: unittest Change-Id: Ifae3d556ff79153ca6c3067347fc259b665fb2e1
2023-05-26Merge "bp2build java_resources that only contain a filegroup" Alix Espino
2023-05-25Merge "Modify error emit condition for checking api files in java_api_library" Jihoon Kang
2023-05-25Modify error emit condition for checking api files in java_api_library Jihoon Kang
java_api_library currently emits error based when the java_api_contribution module has an empty api file or when the module does not have any api files. This may be problematic in partial manifests where allow missing dependency is set, thus add this condition for error emission. Test: go test ./java Bug: 284212875 Change-Id: I10b4baa5723e7a53d931823b3029ea20ac731911
2023-05-24bp2build java_resources that only contain a filegroup Alix
supports filegroup that specifies path property Bug: 280860624 Test: built libauto_value_plugin Change-Id: I9ed0b13e055beb92ba8090f6b5e88b9873c9ce61
2023-05-23data_native_bins is only available in java_test_host, add java_test_host ↵ Kun Niu
properties to java_defaults to make it's available in java_defaults as well. Test: local build Bug: 279622634 Change-Id: Iceaf960d587544ae934424a773a6ae3b17fb443e
2023-05-19Parallelize singleton execution LaMont Jones
Bug: 281536768 Test: manual, presubmits Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
2023-05-19Merge "Disallow missing api source files for java_api_library module" Jihoon Kang
2023-05-17Fix Soong code, remove dead code, and clean up code for Java fuzz Cory Barker
(cherry picked from commit fdf043a7b109250447f7c89bbeb29a1726a4d602) Test: built fuzz targets locally and tested them with Jazzer Change-Id: I3ff487ba4e34289e0f53f2077463f524f4bf4f11
2023-05-17Disallow missing api source files for java_api_library module Jihoon Kang
The purpose of this change is to enable filegroups to be taken as inputs for `java_api_library` module `api_files` property. However, since android.MaybeExistentPathForSource() does not support this, it needs to be replaced with android.PathForModuleSrc(), which checks for the files' existence. Bug: 283006953 Test: go test ./java Change-Id: I8a7d7f200f900219cc17243194a4c26071329ee6
2023-05-11Merge "Delete kotlin/rules.bzl file" Alix Espino
2023-05-09Merge "Delete java/rules.bzl file" Alix Espino
2023-05-08Delete kotlin/rules.bzl file Alix
Bug: 277800767 Test: treehugger Change-Id: I5cff1e4bbb18b9145335169bc4edb0d569525b35
2023-05-05Merge "Provide a resource_prefix_strip for java_resources in bp2build." Treehugger Robot
2023-05-04Provide a resource_prefix_strip for java_resources in bp2build. Romain Jobredeaux
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
2023-05-04Delete java/rules.bzl file Alix
Bug: 277800767 Test: treehugger Change-Id: Idc80cd51317d167fca8d5543bb53c585adeaddad
2023-05-02Use api_levels_released_versions from starlark Cole Faust
Instead of exporting it to soong_injection. Bug: 279095899 Test: m nothing Change-Id: I7b93af233b7450848a475512b5f5682ece773c09 Merged-In: I7b93af233b7450848a475512b5f5682ece773c09
2023-04-27Ignore test apexes from bp2build generated tags Spandan Das
Soong does not enforce apex_available on the contents of test apex. To prevent special-casing test apexes in the apex validation aspect in Bazel, drop the test apexes from the tags altogether. ( The core problem I am trying to solve is making sure that stub libraries in Bazel have a single apex available. apex validation happens to be a nice side benefit) Bug: 277651159 Test: go test ./bp2build Change-Id: Ibb3cfedb5c0f2cda0464bf3758c70b67cb5885d1
2023-04-25Merge "Utilize from text core platform api surface jar in build" Jihoon Kang
2023-04-13Merge "Bp2build support for sdk_version and java_version." Romain Jobredeaux
2023-04-11Bp2build support for sdk_version and java_version. Romain Jobredeaux
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
2023-04-06Utilize from text core platform api surface jar in build Jihoon Kang
Use JavaApiLibraryName function to redirect the usage of core platform api stubs from .txt files based on config. Test: m --build-from-text-stub Change-Id: I926a0a455fed301ba4ff9dfa509d4dbbbd076029
2023-04-05Merge "Update java_api_library in testing modules" Jihoon Kang
2023-04-04Support arch variants in java's StaticLibs in bp2build Romain Jobredeaux
Test: Presubmits Bug: 276901800 Change-Id: I6058a726833ef10a5f470946e2d265b20fa547ce
2023-04-04Update java_api_library in testing modules Jihoon Kang
The full api surface java_api_library modules are currently defined as java_library modules instead of java_api_library modules. This change corrects this and modifies the DepsInfo of java_api_library so that it can be compatible in tests. Test: go ./java Change-Id: I540b5a930f506ce5f7663ab6e07c6df49af15cf9
2023-04-03Add dep_api_srcs property to java_api_library module Jihoon Kang
Users can pass the jar-file creating module via dep_api_srcs property in java_api_library to create the jar file not by compiling the stubs generated from metalava but by extracting and zipping the class files from the jar file of the input module. Test: m android-non-updatable.stubs.from-text Bug: 273381329 Change-Id: Id1b75179111cc7ff45faaff58388db1347bb18e5
2023-03-31rename aidl/library.bzl to aidl/aidl_library.bzl Sam Delmerico
Test: b test --config=android //build/bazel/... Change-Id: I7e22ee5ffa391ddaf43a3eec17812be78f2d86ab
2023-03-29Merge "Modify Soong to utilize from-text android.jar in build" Treehugger Robot
2023-03-28Merge "Compile stubs to .dex" Spandan Das
2023-03-28Modify Soong to utilize from-text android.jar in build Jihoon Kang
Context - from-text android.jar files are built using Metalava, and these can be utilized in `decodeSdkDep` so that any modules that depends on APIs can be compiled using from-text android.jars - This change removes dependency on source java files when compiling stub android.jar files Implementation - Modify java_api_library module to create system modules using the generated android.jar - Replace modules in decodeSdkDep to link against java_api_library modules - Add --build-from-text-stub flag to hide the feature behind a flag Test: m --build-from-text-stub Bug: 271154441 Change-Id: I104df595edc65c0006820d5ae5b15f1fb167e190
2023-03-28Merge "Update max_sdk_version from SdkSpec to ApiLevel" Spandan Das
2023-03-24Add apex_available aidl + aidl&lang libraries Liz Kammer
Test: b build com.android.neuralnetworks com.android.media.swcodec Change-Id: I008b915b22e4c8c2cf1f0aee6cfdaf17374cb3a9
2023-03-23Compile stubs to .dex Spandan Das
Although stubs are not installable on device, we need to compile .dex to support hiddenapi metadata generation. Bug: 271443071 Test: Built out/soong/hiddenapi/hiddenapi-stub-flags.txt with aosp/2487266 (There is still some delta due to missing signatures in child classes) (Will address them in a followup CL) Change-Id: Iac1330c449934085a479c487a1489aa1695a75ee Change-Id: I1baa9c0f45eb8fc93f5c3177389ea5a2b7ca0a0b
2023-03-23Update max_sdk_version from SdkSpec to ApiLevel Spandan Das
max_sdk_version signifies device version and does not need an sdkKind to describe it fully. Update the type and cleanup existing usages. As a side benefit, we also get better error handling since users can no longer enter something like `public_30` as a valid max_sdk_version in bp files Bug: 208456999 Test: no change in ninja file (this should be a no-op) Test: TH Change-Id: I304b5ad802bde200137d8e225182828dfd6f7227
2023-03-23Update target_sdk_version from SdkSpec to ApiLevel Spandan Das
target_sdk_version signifies device version and does not need an sdkKind to describe it fully. Update the type and cleanup existing usages. As a side benefit, we also get better error handling since users can no longer enter something like `public_30` as a valid target_sdk_version in bp files Test: m nothing Test: no change in ninja files (this should be a no-op) Bug: 208456999 Change-Id: I3c19245e29184bd9e5660ad8981966f64dfa9424
2023-03-22Update min_sdk_version from SdkSpec to ApiLevel Spandan Das
This relands aosp/2457063. The original change broke T and U since those branches still contain soong modules of type (kind+level). Those soong modules have been cleaned up now Test: Used go/abtd to test T and U branches with this change Bug: 208456999 Change-Id: I0ef7933c055f88cb512a02108f1173e51156ef1c
2023-03-21Revert "Update min_sdk_version from SdkSpec to ApiLevel" Spandan Das
Revert submission 2457063 Reason for revert: Broken udc-dev Reverted changes: /q/submissionid:2457063 Change-Id: Id6349fc1318877044af713c914a0afd437d3d2d5
2023-03-20Update min_sdk_version from SdkSpec to ApiLevel Spandan Das
min_sdk_version signifies device version and does not need an sdkKind to describe it fully. Update the type and cleanup existing usages. As a side benefit, we also get better error handling since users can no longer enter something like `public_30` as a valid min_sdk_version in bp files Will do a similar cleanup for targetSdkVersion and maxSdkVersion in a followup CL Test: m nothing Test: no change in ninja files (this should be a no-op) Bug: 208456999 Change-Id: Ie6ae7e267d093c5e4787e82685daaca1021d202e
2023-03-16Create helper function for BazelTargetModuleProperties in java/android Alix
Prevents inconsistent load locations from being added for java_library, android_library, kt_jvm_library targets that are generated in multiple places. Change-Id: I66ae5af137d7dff3f6fa6660dee539cf9ab22b9e Test: go test ./bp2build
2023-03-16Create an intermediate java library for every java_binary target Romain Jobredeaux
We're already doing this for kotlin libraries as java_binary does not support kotlin sources. Change-Id: I4967b3aca21dac8e0eaf54d48cc35d57a4c4923e
2023-03-14bp2build kotlinCFlags Alix
for java_library, java_binary, android_app & android_library Change-Id: Ia8dec7e7d497eb41b2d8dcd8c44c3090d1d3b4bd Bug: 271265771 Test: go test ./bp2build
2023-03-13Merge "Update load statements in java.go bp2build" Alix Espino
2023-03-13Update load statements in java.go bp2build Alix
load statements will all now point to rules.bzl files and won't have to be constantly updated. Bug: 271612705 Test: CI Change-Id: I663b9730f1b5b333682ea301ce4d9a505626faaa
2023-03-09Merge "Call ResolveExcludes after arch-based sources computation in java.go" Romain Jobredeaux
2023-03-08Call ResolveExcludes after arch-based sources computation in java.go Romain Jobredeaux
TEST: go test Change-Id: I93a8ae5e0842dab03f73b0edb32841755d2ea435