aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge "Update max_sdk_version from SdkSpec to ApiLevel"Spandan Das2023-03-281-3/+4
|\ \ \ | |_|/ |/| |
| * | Update max_sdk_version from SdkSpec to ApiLevelSpandan Das2023-03-231-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add apex_available aidl + aidl&lang librariesLiz Kammer2023-03-241-0/+6
|/ / | | | | | | | | Test: b build com.android.neuralnetworks com.android.media.swcodec Change-Id: I008b915b22e4c8c2cf1f0aee6cfdaf17374cb3a9
* | Update target_sdk_version from SdkSpec to ApiLevelSpandan Das2023-03-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Update min_sdk_version from SdkSpec to ApiLevelSpandan Das2023-03-221-8/+7
|/ | | | | | | | | | | 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
* Revert "Update min_sdk_version from SdkSpec to ApiLevel"Spandan Das2023-03-211-7/+8
| | | | | | | | | | Revert submission 2457063 Reason for revert: Broken udc-dev Reverted changes: /q/submissionid:2457063 Change-Id: Id6349fc1318877044af713c914a0afd437d3d2d5
* Update min_sdk_version from SdkSpec to ApiLevelSpandan Das2023-03-201-8/+7
| | | | | | | | | | | | | | | | | 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
* Create helper function for BazelTargetModuleProperties in java/androidAlix2023-03-161-20/+19
| | | | | | | | | 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
* Create an intermediate java library for every java_binary targetRomain Jobredeaux2023-03-161-15/+23
| | | | | | | We're already doing this for kotlin libraries as java_binary does not support kotlin sources. Change-Id: I4967b3aca21dac8e0eaf54d48cc35d57a4c4923e
* bp2build kotlinCFlagsAlix2023-03-141-4/+6
| | | | | | | | for java_library, java_binary, android_app & android_library Change-Id: Ia8dec7e7d497eb41b2d8dcd8c44c3090d1d3b4bd Bug: 271265771 Test: go test ./bp2build
* Merge "Update load statements in java.go bp2build"Alix Espino2023-03-131-6/+16
|\
| * Update load statements in java.go bp2buildAlix2023-03-131-6/+16
| | | | | | | | | | | | | | | | | | 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
* | Merge "Call ResolveExcludes after arch-based sources computation in java.go"Romain Jobredeaux2023-03-091-0/+1
|\ \ | |/ |/|
| * Call ResolveExcludes after arch-based sources computation in java.goRomain Jobredeaux2023-03-081-0/+1
| | | | | | | | | | TEST: go test Change-Id: I93a8ae5e0842dab03f73b0edb32841755d2ea435
* | Created kotlinAttributes structAlix2023-03-081-23/+25
|/ | | | | | | | | makes it clearer which attributes are kotlin specific embedded within javaCommonAttributes since both java_* and android_* use kotlin. Change-Id: Ib7c9b912a9901cd1c3d150ab1e0a79011d8e07de Test: go test ./bp2build
* code cleanup for bp2build java_binary with kt srcsAlix2023-03-031-16/+4
| | | | | | | there is now support for resoure_strip_prefix in kt_jvm_library targets. Test: built AnalyzerKt and updated go ./bp2build tests Change-Id: I4a6fe45276d45519186b6f40a02db990511d6def
* resource_strip_prefix support for kotlin srcsAlix2023-03-031-2/+2
| | | | | | | | change load locations for kt_jvm_library to be the macro Change-Id: Id50fcb1f880013fe57647a065cd6b7149d7c5d91 Test: built kotlinx_coroutines locally and compared jar file to soong Bug: 268519061
* Merge "Rename output stubs jar file in java_api_library"Jihoon Kang2023-03-011-1/+1
|\
| * Rename output stubs jar file in java_api_libraryJihoon Kang2023-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating framework.aidl, `android_*_stubs_current` are converted to .aidl files (and created as targets) by replacing the extension from `.jar` to `.aidl`. Thus, when replacing `android_*_stubs_current` to java_api_library modules, generating `android.jar` files leads to ninja error(multiple rules for generating */android.aidl error). Prevent this error by renaming the name of the artifact jar file as the module name so that distinct-named ninja targets can be created. Test: m Change-Id: Iaa7248996d7bf5e7f98e1d1e2919870c3cccf5a6
* | Merge "Reland^2 "Target Java 17""Sorin Basca2023-03-011-7/+1
|\ \
| * | Reland^2 "Target Java 17"Sorin Basca2023-02-151-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 91ba6c7e01e03bde6e2f24b6d093603391149ae7. Reason for revert: Relanding Java 17 Change-Id: I6d0e64bb86b9f4a0f41baa33c3226c6316718456
| * | Revert "Reland "Target Java 17""Julien Desprez2023-02-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1fbf7f21a452d372c629e6736ee17a216c23a926. Reason for revert: broke docker image, pinning is incomplete it seems Change-Id: I7102cb233a4fe5ce0f5a1ead98cfc661c3d82ce5
* | | Update usages of min_sdk_version that relies on (kind+level)Spandan Das2023-02-271-5/+8
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | The type of min_sdk_version is being migrated from android.SdkSpec(kind+level) to android.ApiLevel(level). This affects `ShouldSupportSdkVersion` for java modules. This function skips the check for modules compiling against `core`, and that requires access to SdkVersion and not MinSdkVersion after the migration. Skip the check explicitly using SdkVersion. Test: go test ./java Test: No change in ninja file Bug: 208456999 Change-Id: I14eca4f8e8c5d7477ded00c4fe54097323fab4a2
* | Merge "Revert "Revert "R8/D8 should use sdk_version prop to determine API ↵Treehugger Robot2023-02-231-1/+9
|\ \ | | | | | | | | | surface stability."""
| * | Revert "Revert "R8/D8 should use sdk_version prop to determine API surface ↵Spandan Das2023-02-231-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stability."" This reverts commit 7eb9243fa78189000da9d5beeabaea3b8b2c0fd5. Reason for revert: The original change was reverted since it was suspected to cause missing libc++.so errors. It was a red herring, and the root cause has been fixed now b/264588525 Change-Id: Ib9110c41bacf220b91f24de11589f63235895e56
* | | temporary unblock for builds using sdkSystemAlix2023-02-211-0/+3
| | | | | | | | | | | | | | | | | | Bug: 215230098 Change-Id: I521342c676f3362d3e1db0aab7924a04602525e1 Test: built captiveportal-lib and inspected BUILD file
* | | Merge changes I55a5a295,I9c09451d,I05177388Treehugger Robot2023-02-161-5/+28
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * changes: Use the profiles in the APEX to dexpreopt system server jars. Add tests for the ignored "profile_guided: true" property. Output dex_preopt to SDK snapshot.
| * | | Use the profiles in the APEX to dexpreopt system server jars.Jiakai Zhang2023-02-151-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change, if "profile_guided: true" is set, profile-guided compilation will be enabled for the jar and the ".prof" file next to the jar in the APEX ("javalib/<name>.jar.prof") will be used as the profile when dexpreopting for the prebuilt APEX. Bug: 241823638 Test: m nothing Test: - 1. (on internal master) Patch aosp/2426453. 2. Build the APEX bundle and the module SDK of com.android.wifi 3. (on tm-dev) Patch this CL and aosp/2141972. 4. Copy the APEX bundle and the module SDK built on step 2 to the source tree 5. Disable hiddenapi check 6. lunch cf_x86_64_phone-userdebug && m MODULE_BUILD_FROM_SOURCE=false com.google.android.wifi 7. cat out/soong/.intermediates/prebuilts/module_sdk/Wifi/current/prebuilt_service-wifi/android_common_com.android.wifi/dexpreopt/oat/x86_64/javalib.invocation 8. See the profile being used. Change-Id: I55a5a295e9c5d6f0564afb139c5fb7da91ab8cae
| * | | Output dex_preopt to SDK snapshot.Jiakai Zhang2023-02-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed to determine whether we need to deapex the profile or not. Bug: 241823638 Test: m nothing Test: - 1. Patch ag/20582608 PS2. 2. TARGET_BUILD_APPS=com.android.wifi packages/modules/common/build/mainline_modules_sdks.sh 3. See the `dex_preopt` property being written. Change-Id: I05177388c24be1ab315247ea85e7e3a8600cebd3
| * | | Merge "Reland "Target Java 17""Sorin Basca2023-02-091-7/+1
| |\ \ \ | | | |/ | | |/|
| | * | Reland "Target Java 17"Sorin Basca2023-02-031-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 384250c7c45c01f474b0e941890382e6d097cca2. Reason for revert: Relanding the feature. Bug: 233029164 Change-Id: Ib66deabbf6e9604798c70edaf581f46db848e6ca
* | | | Add static_libs property in java_api_library soong moduleJihoon Kang2023-02-151-2/+19
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Package private stub annotations are not part of any API surfaces, but are included in the `android_<API_SURFACE_NAME>_stubs_current`. Since these cannot be included in the java_api_library by api_contributions, add static_libs property to statically include jars in the output jar file. Test: m Change-Id: Icb4401f29079ba32df4c192943a7e8814599d9ba
* | | Merge "Revert "Target Java 17""Kelvin Zhang2023-02-021-1/+7
|\| |
| * | Revert "Target Java 17"Sorin Basca2023-02-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d6be9e51ca5d935087d6735dd5d8dc2c40801ae7. Reason for revert: b/267608166. Change-Id: Ie07caa5ace3bcb290829e6fa476c5e1d47b975ba Fixed: 267608166
* | | Merge "Target Java 17"Sorin Basca2023-02-021-7/+1
|\| |
| * | Target Java 17Sorin Basca2023-01-111-7/+1
| | | | | | | | | | | | | | | | | | Bug: 233029164 Test: TH Change-Id: I750b866565c264eb4f4ac14ebc88be6fc9b1b458
* | | Merge "Generate java_api_contribution module from droidstubs module"Jihoon Kang2023-01-261-2/+10
|\ \ \
| * | | Generate java_api_contribution module from droidstubs moduleJihoon Kang2023-01-261-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context - droidstubs module are either generated from the java_sdk_library module or defined in the bp files. - Since droidstubs module contains API text file property, java_api_contribution module can by dynamically created from droidstubs. Implementation - Add `api_surface` property in droidstubs module. This property is either inherited from the java_sdk_library or written in the module definition in the bp file. - Add defaultable hook in droidstubs module to generate the child java_api_contribution module. Test: m Change-Id: Ica43d65614723c623cd0c155266f9844e69e5d5e
* | | | Merge "arch variant support for libs property"Alix Espino2023-01-261-7/+13
|\ \ \ \ | |/ / / |/| | |
| * | | arch variant support for libs propertyAlix2023-01-191-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | Test: bp2build tests and manually inspected Build file for libprotobuf-java-lite Bug: 244210934 Change-Id: Id60d859eea2c23fa7a29784faeed5cb050d4193e
* | | | Merge "transitive Java deps for r8"Sam Delmerico2023-01-251-1/+10
|\ \ \ \
| * | | | transitive Java deps for r8Sam Delmerico2023-01-201-1/+10
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -libraryjars argument to r8 was missing transitive dependencies, and so complained when there were classes used in the program JAR which were not provided via libraries. This CL propagates transitive dependencies to the r8 command to reduce the warnings that are generated for missing classes. Bug: 242088131 Change-Id: Ifad7bc7c5d406e3de8d98ea963c97e88c84b45a1
* | | | Add libs property to java_api_library moduleJihoon Kang2023-01-241-4/+22
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | Module Lib API surface takes modules that are not part of the API surface as classpath during compilation of the JAR file. Thus, add libs property to add deps in bp module definition. Test: m Change-Id: I8967d53430fa4cc8e4aa431770ba4e97893f8c61
* | | Getting rid of old hacky Libs conversionAlix2023-01-191-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that libs conversion is happening for the needed module_types, removing if statement with old hacky libs conversion Test: Presubmit Bug: 244210934 Change-Id: I92bb2080eeb7dcb85d087a3ff6054bdf8675ec54
* | | support libs for java_plugin -> *Alix2023-01-171-3/+1
| | | | | | | | | | | | | | | | | | Test: bp2build tests Bug: 244210934 Change-Id: I7dbc820b23c4129485b0991aefb41e00e434d94e
* | | Merge "libs support for android_app->* edge"Alix Espino2023-01-171-1/+3
|\ \ \
| * | | libs support for android_app->* edgeAlix2023-01-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Test: bp2build tests Bug: 258688914 Change-Id: I2e24c484019c994b43509f350b3c090a40c3ba6a
* | | | Merge "Add java_api_library properties to java_defaults"Jihoon Kang2023-01-121-1/+2
|\ \ \ \ | |/ / / |/| | |
| * | | Add java_api_library properties to java_defaultsJihoon Kang2023-01-101-1/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context - Some Java API surfaces have subset relationships (i.e. public API surface is a subset of system API surface). Thus, simply listing all API files that contributes to hierarchical API surfaces when defining java_api_library modules can lead to repetition of code in Android.bp files. - Utilizing java_defaults can resolve this problem by grouping java_api_contribution modules by API surfaces, and reduce code repetition and enhance readability. Implementation - Modify java_api_library module to utilize java_defaults modules. Test: m Change-Id: I6adead208ca36c21de72ee39c4f532b84af8a153
* / / java_binary with kotlin sourcesAlix2023-01-091-16/+54
|/ / | | | | | | | | Test: bp2build conversion tests and inspected build file for AnalyzerKt Change-Id: I0f6d5c3d371a9dbd000b74144ad68d5d8bd156cf