aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge changes I07db8afc,Ia89e0239Treehugger Robot2023-01-071-6/+0
|\ \ | | | | | | | | | | | | | | | * changes: Stop module types being SdkAware Replace usages of SdkAware in sdk module with Module
| * | Stop module types being SdkAwarePaul Duffin2022-12-121-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | Removes all usages of SdkBase and InitSdkAwareModule. Bug: 260237150 Test: m nothing Change-Id: I07db8afc805eadbeb5b23f2e1d2f51567eecfab0
* | | Merge "support libs for android_library"Treehugger Robot2023-01-061-1/+1
|\ \ \
| * | | support libs for android_libraryAlix2023-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adds support for *-> android_library and android_library->* edges Change-Id: I41d4e1d1b8106a17e67951d47e67b59ef3170d17 Test: manually inspected build files for libWallpaperPicker & android-suppor-v4
* | | | Merge "Revert "R8/D8 should use sdk_version prop to determine API surface ↵Spandan Das2023-01-051-9/+1
|\ \ \ \ | | |_|/ | |/| | | | | | stability.""
| * | | Revert "R8/D8 should use sdk_version prop to determine API surface stability."Spandan Das2023-01-041-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit daa220ae8ce36c3c155bb35b205a5826c779202c. Reason for revert: Suspected to be a cause for build failure (b/264446640). Will use go/abtd to verify Change-Id: Ibfdf893f2426b1119923467027e0acedd08808c1
* | | | Merge "Libs support for * -> java_library_edge with kt sources"Alix Espino2023-01-041-10/+8
|\ \ \ \
| * | | | Libs support for * -> java_library_edge with kt sourcesAlix2022-12-151-10/+8
| | |_|/ | |/| | | | | | | | | | | | | | | | | | Bug: 244210934 Test: bo2build tests and built kotlinx_atomicfu Change-Id: Id6eac2f104878e4d7902a32e846ef1cc87dd7863
* | | | Merge "Allow adding extra tradefed options in the Android.bp file"Cole Faust2023-01-041-5/+23
|\ \ \ \
| * | | | Allow adding extra tradefed options in the Android.bp fileCole Faust2023-01-031-5/+23
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests need to add custom tradefed options, but still want to keep most of the soong autogenerated tradefed xml file. Expose a test_options: { tradefed_options: [...] } property that will allow tests to add more options to the autogenerated xml file. Fixes: 184895128 Test: go test, and verified that the ninja files did not change for aosp_arm64 Change-Id: I50d4ad139322e9e207202f1e1a50f5bbb424aa6f
* | | | Merge "R8/D8 should use sdk_version prop to determine API surface stability."Treehugger Robot2023-01-041-1/+9
|\ \ \ \ | |/ / / |/| | / | | |/ | |/|
| * | R8/D8 should use sdk_version prop to determine API surface stability.Spandan Das2023-01-041-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `min_sdk_version` is used to represent the api_level of the device and its type will eventually become android.ApiLevel. OTOH, `sdk_version` property represents the API surface a module builds against _and_ the version of that API surface. For R8/D8, the additional `--android-platform-build` should be determined using the sdk_version of the soong module and not min_sdk_version, since min_sdk_version will not contain information about the api surface used for compilation. The unit test for `core_platform_app` in TestR8 were passing since min_sdk_version was not set, and therefore it implicitly defaulted to sdk_version. Also created a custom struct to propagate params to the helper dex functions Test: In build/soong, go test ./java Test: TH Bug: 208456999 Change-Id: I08ac6f496444d603557e498c8a1794af665abc7a
* | | Set Java version for java_api_library moduleJihoon Kang2022-12-271-0/+6
|/ / | | | | | | | | | | | | | | | | | | Currently, stubs are compiled with Java version 1.8. To align with this, set the java version passed to javac invocation as 1.8 for java_api_library module. Helper function is used to sync the java version of droiddoc module and java_api_library module. Test: m Change-Id: I103b94aed9747a2f2dd65d13de0ae9c0f33db5c0
* | Merge "Revert "Allow adding extra tradefed options in the Android.bp file""Jigar Thakkar2022-12-201-23/+4
|\ \
| * | Revert "Allow adding extra tradefed options in the Android.bp file"Tahsin Loqman2022-12-191-23/+4
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8ec823cba166a41eb0e9e5ff8fe679e691fec678. Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
* | | Revert "Revert "Include proguard flag files from transitive java_library deps""Jared Duke2022-12-191-0/+22
|/ / | | | | | | | | | | | | | | This reverts commit 6f7e288fb5ea2fb01d9093fd57081a82c09a6618. Reason for revert: Downstream proguard usage has been fixed. Change-Id: I3667e7e908eebc62c640b42cb96b04993fc66e45
* / Allow adding extra tradefed options in the Android.bp fileCole Faust2022-12-091-4/+23
|/ | | | | | | | | | | | Some tests need to add custom tradefed options, but still want to keep most of the soong autogenerated tradefed xml file. Expose a test_options: { tradefed_options: [...] } property that will allow tests to add more options to the autogenerated xml file. Fixes: 184895128 Test: go test, and verified that the ninja files did not change for aosp_arm64 Change-Id: I75f7eb002c8325ce7cdc76e12e76e16195320620
* Add an api_files property in java_api_librarySpandan Das2022-12-051-0/+13
| | | | | | | | | | | | java_api_contribution is useful to java_api_library when the api files are not colocated. If they are colocated (e.g. in Multi-tree assembled api_surfaces directory), it is useful to refer to them directly without nedding to create a java_api_contribution module. Test: In build/soong, go test ./java Change-Id: I5b4e557068a1e5c71a80c76452030e72ec83a696
* Merge "Bp2Build for libs property in java_library"Alix Espino2022-11-301-3/+12
|\
| * Bp2Build for libs property in java_libraryAlix2022-11-291-3/+12
| | | | | | | | | | | | | | | | 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
* | Merge "Add phony rule for java_api_library module type"Jihoon Kang2022-11-301-1/+3
|\ \
| * | Add phony rule for java_api_library module typeJihoon Kang2022-11-291-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | Context - Create phony rule for java_api_library module with its artifact (*.jar) as dependency - Fix source directory base mislinkage issue for input text files passed from java_api_contributions modules Test: m Change-Id: I055332fd5bc7ef0d03e7b311b0efa93f4454102f
* / Output min_sdk_version to snapshotPaul Duffin2022-11-261-0/+14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | The min_sdk_version was added to the java_import in Tiramisu. This change will propagate the min_sdk_version set on a java_library to the java_import snapshot. If possible the min_sdk_version will be resolved into a numerical version to ensure consistent behavior across build releases. Bug: 260560424 Test: m nothing BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh # Ran above before and after this change and made sure that only # Tiramisu, UpsideDownCake and latest were changed and those changes # were the addition of a min_sdk_version property. # # Ran the following command in tm-mainline-prod: # lunch cf_x86_64_phone-userdebug # m ART_MODULE_BUILD_FROM_SOURCE=false nothing`. # # It failed with: # module "prebuilt_okhttp-norepackage" variant "android_common": should support min_sdk_version(33) for "AdServicesApk": min_sdk_version is not specified. # # Unpacked the Tiramisu art snapshot generated with this change into # tm-mainline-prod and reran the previous command and it succeeded. Change-Id: I9d9d730845554fc175d17f38c038e4e3c7d39e07
* Merge "Update java_api_library prop name"Jihoon Kang2022-11-211-16/+11
|\
| * Update java_api_library prop nameJihoon Kang2022-11-191-16/+11
| | | | | | | | | | | | | | | | | | | | Context - Update java_api_library module's prop name from api_providers to api_contributions to adjust to module rename - Update variables name correspondingly to enhance readability Test: m Change-Id: I93b941a572e04bed6084109d151ba83a82715651
* | Merge "Revert "Improve error reporting when depending on prebuilt ↵Paul Duffin2022-11-211-54/+26
|\ \ | |/ |/| | | implementation jar""
| * Revert "Improve error reporting when depending on prebuilt implementation jar"Paul Duffin2022-11-211-54/+26
| | | | | | | | | | | | | | | | | | This reverts commit c61783b20d70789d657dcb82050369480cc443c7. Bug: 257969510 Reason for revert: b/255275437 - breaks checkbuild target Change-Id: I01f88053cc24dbc1a4eb5c009f15473bdff3d565
* | Merge "Create java_api_contribution and java_api_library module"Jihoon Kang2022-11-171-0/+179
|\ \
| * | Create java_api_contribution and java_api_library moduleJihoon Kang2022-11-161-0/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context - Droidstubs module is currently responsible not only for java api stubs generation, but also for checking api equality and compatibility. - Generating stubs with incomplete api text file that does not list entire api surface is done through metalava implicitly adding unlisted methods from java source files to the stubs in droidstubs module. - These factors make java stubs generation harder to debug, thus introduce `java_api_contribution` and `java_api_library` modules to make java api stubs and jar generation more explicit in Android.bp level and eventually easier to debug. Implementation - `java_api_contribution` module is included in api domains' directory and lists api text file directory to be added to the api surface - `java_api_library` collects all api text file that forms the api surface and creates stubs invoking metalava. Generated java stub files are converted into `.srcjar`, and eventually `.jar` file which is the complete api surface. Test: m Change-Id: I86f097cc8592334a5eaa900cec12764c5fcc09e7
* | | Merge "bp2build for java_library with .kt srcs or common_srcs"Alix Espino2022-11-161-14/+46
|\ \ \ | |_|/ |/| |
| * | bp2build for java_library with .kt srcs or common_srcsAlix2022-11-151-14/+46
| |/ | | | | | | | | | | | | | | | | 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
* / Improve error reporting when depending on prebuilt implementation jarPaul Duffin2022-11-141-26/+54
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sdk snapshot must not be including implementation code for boot libraries, the implementation is provided by dex jars within the corresponding APEX. However, the snapshot does need a module for each boot library so that the build can seamlessly access the dex files from the APEX. A java_library boot library (like core-oj) is represented in the snapshot by a java_import module which requires a jar file to be provided, otherwise it is disabled. However, that is provided purely to keep Soong happy and should never be used. Previously, the snapshot would contain an empty file for the jar. As an empty file is an invalid jar any tool (like compiler) that tried to consume it would fail which was the correct behavior. Unfortunately, the error message that was produced was not very helpful, it was just some variant on `invalid file` which lead to a lot of bugs being raised. This change replaces that empty file with a reference to the output from a genrule which runs a script which produces a more useful error message, with information on how to fix the issue, and fails the build. It also adds a Name() method to the SdkMemberProperties type as that is needed in AddInternalModule() to construct the name of the additional module. Tested as follows: In AOSP/master make the following changes: 1. Temporarily set visibility on core-oj and core-libart to //visibility:public. 2. Run packages/modules/common/build/mainline_modules_sdks.py to create the snapshots. For each of the S, T and latest snapshots I did the following in the s-aml-prebuilt-test, t-aml-prebuilt-test and aosp/master branches: 1. Created an Android.bp file containing the following: java_library { name: "broken", static_libs: [ "prebuilt_core-libart", "prebuilt_core-oj", ], } 2. Fix the visibility issues and run `m broken` where it fails with an invalid file. 3. Delete the contents of the prebuilts/module_sdk/art/current/sdk directory. 4. Unpack the relevant version of the art-module-sdk snapshot into the directory. 5. Run `m broken` where it fails with the helpful message. 6. Test the instructions on how to use the ninja -t path tool to identify the cause of the problem and fix it. Bug: 257969510 Test: See above. Change-Id: I125bde2d7202afff84c97daebcef37e21c548a3a
* Merge "move logtags rule from //build/make to //build/bazel"Sam Delmerico2022-11-011-1/+1
|\
| * move logtags rule from //build/make to //build/bazelSam Delmerico2022-04-081-1/+1
| | | | | | | | | | Test: b build //packages/apps/QuickSearchBox Change-Id: I7e4d231ad12d04bd44bfdbc595e32a242953c46b
* | Merge "Generate a default wrapper for device java_binary"Treehugger Robot2022-10-311-1/+33
|\ \
| * | Generate a default wrapper for device java_binaryZi Wang2022-10-271-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any device java_binary that doesn't have a specific wrapper must have a main_class property, which is used to generate its default wrapper. Otherwise its build should fail. Bug: 250851599 Test: TestDeviceBinaryWrapperGeneration in java_test.go Change-Id: Ice4c580bcfc1b92f95e217b39e984c55d25a3a02
* | | Bp2build Java libs for java_binary -> java_import edgeAlix2022-10-281-6/+30
|/ / | | | | | | | | | | | | | | | | Since Bazel's java_import requires a jars attribute to be specified, the generated neverlink-duplicated module is of type java_library Change-Id: I14a866dfc583507a9462add50d95060cbfe540c5 Bug: 244210934 Test: m bp2build, go test ./bp2build, manual inspection of generated Build and jar files
* | Merge "Specify jnilib partition in Android-<target>.mk"Jihoon Kang2022-10-051-0/+1
|\ \
| * | Specify jnilib partition in Android-<target>.mkJihoon Kang2022-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context - Android-<target>.mk currently does not contain information about partition for its dependent unembedded jni libraries, but only lists the name of the unembedded jni libraries. - If an android_app module depends on an unembedded jni library that is located in a different partition, make cannot find the library. Implementation - Create a string field partition in jniLib struct. - Add variable "LOCAL_SOONG_JNI_LIBS_PARTITION_<target>", an array of mappings of the name of the jni library to its partition. Bug: 154162945 Test: m Change-Id: I6b8e1272ff59dc70e3dd6ce8c6c8e4686dad76df
* | | Change deptag for sdk deps to help distinguishLiz Kammer2022-09-301-5/+6
| | | | | | | | | | | | | | | Test: m nothing before and after and diff build.ninja files Change-Id: Idc4c7f86d3e626bd1ee2f90ae3c6fb755644a605
* | | add jacocoagent by default to Java modulesSam Delmerico2022-09-091-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | On coverage builds, R8 will fail to properly optimize and fail the build if ignore_warnings: false, because jacoco injects dependencies on jacocoagent classes, but the jacocoagent library is not part of the classpath libraries passed in to R8 in its arguments. Instead we can add jacocoagent as a libs dependency for these modules so that it will get pulled into the r8 flags. Bug: 243903417 Test: m Change-Id: Icc24cc260b896fc800125a0318308d823ccf7a83
* | convert .aidl srcs for java_librarySam Delmerico2022-08-251-12/+57
| | | | | | | | | | | | | | | | | | 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
* | Add hidden API properties to java_sdk_library modulesPaul Duffin2022-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, hidden API properties were only allowed on bootclasspath_fragment and platform_bootclasspath module types. This change allows them to be specified on java_sdk_library modules too. It involves the following changes: 1. Add the properties to the java.Module. 2. Populate and provide a HiddenAPIPropertyInfo struct from java_sdk_library modules. 3. Modify bootclasspath_fragment to merge information gathered from its content libraries as if it was specified on the fragment itself. Bug: 240406019 Test: m nothing packages/modules/common/build/mainline_modules_sdks.sh # Ran the previous command with and without this change to make # sure that this change does not change the sdk snapshot # contents. Change-Id: I64eb71c2039ddc14cf380689d0cec7ec221f5b88
* | Merge "Move common test_options properties into the android package"Zhenhuang Wang2022-08-171-3/+2
|\ \
| * | Move common test_options properties into the android packageZhenhuang Wang2022-08-171-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Multiple modules (e.g. java, cc, python, rust) define the `test_options` field. Extract the common properties in test_options to share across different test rules. Bug: 240928948 Test: `refreshmod` and diff with original module-info.json Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
* | | Add lint test propertyCole Faust2022-08-111-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | Some libraries are only used for tests, but are not test module types. These modules get warnings about @VisibleForTesting usages when they really shouldn't. Expose a test flag that module authors can use to make lint treat a module as test code. Bug: 235339747 Test: Manually tested applying it to SystemUI-tests Change-Id: I1356749a669dc80a7725605d7159da27c9a211b4
* | Bp2Build converter for android_library_import and android_library.Romain Jobredeaux2022-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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
* | add java_import to mixed buildSam Delmerico2022-07-261-35/+94
| | | | | | | | | | | | | | | | | | Bug: 220168131 Test: go test ./java -run TestImportMixedBuild Test: USE_BAZEL_ANALYSIS=1 m CtsManagedProfileApp && verify jars are included from execroot/__main__ directory Test: build/bazel/ci/mixed_droid.sh Change-Id: I6d35a2389ea35525d532efc8474c71d2c8825646
* | Merge "Use implementation jar for updatable-media in snapshot for S"Paul Duffin2022-07-151-6/+24
|\ \
| * | Use implementation jar for updatable-media in snapshot for SPaul Duffin2022-07-151-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While enabling prebuilts in T we hit b/229932396 which was caused by some parts of the build depending on the prebuilt updatable-media jar which used to be a full implementation jar but which is now an invalid jar as the snapshot must not be including implementation details. We fixed the issue in T but we are hitting the same problem in S with the M-2022-07. That is the first train in which the prebuilt updatable-media module provides an invalid jar, prior to that it was always providing an implementation jar. This change tweaks the sdk snapshot generation code to use an implementation jar for updatable-media in the S snapshot to avoid partners having to cherry pick changes similar to those needed to fix b/229932396 in T. Bug: 239121291 Test: packages/modules/common/build/mainline_modules_sdks.sh # Check that S media snapshot includes implementation jar. # Check that S art snapshot includes invalid jar. # Check that T media snapshot includes invalid jar. Change-Id: Ib49484d00a60b4ed7f8268e04f9c10a3498edb56