summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2025-01-15Convert collectDeps and collectTransitiveHeaderJarsForR8 to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I957c09bba8fc047cb8959461294d8879486185a6
2025-01-13Merge changes I4fb8fc36,I5d7150fe into main Yu Liu
* changes: Convert classLoaderContextForUsesLibDeps to use ModuleProxy. Convert checkSdkVersions to use ModuleProxy.
2025-01-10Merge "_test module types shouldn't override user-set test property" into main Cole Faust
2025-01-10_test module types shouldn't override user-set test property Cole Faust
Android lint considers code "test" code depending on if the --test flag is passed. We pass it by default for *_test module types, but also allow the user to control it via the "lint: { test: true }" property. However, the module types were overriding the user-defined test property if the user-defined one was supplied via a defaults module. Split the test property into two so that modules can use a separate lower priority one from the user-controlled one. Fixes: 358643466 Test: m nothing --no-skip-soong-tests Change-Id: I1b1ef7a73ca9f413aa29e0c6025134fc52dc7caf
2025-01-10Convert checkSdkVersions to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I5d7150feb8dbb84ac4e01059e76f451fbfc5f7eb
2025-01-10Convert hasCode and aaptLibs to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Ie937a236f3c286fb5b2cd439614f09f7a85e884f
2025-01-03Extract proguard rules found in imported JAR archives Luca Stefani
In Android Studio R8 is able to use bundled proguard rules found both in AAR archives (under /proguard.txt) and JAR archives (under /META-INF/proguard/*) Soong currently only handles the _easier_ AAR format and ignores the possibility to have rules in JAR archives. To support those rules we use the newly introduced ExtractR8Rules cli tool in R8 to extract all the embedded rules in the imported JAR for later propagation. Bug: 377144587 Test: m, including okhttp-4.12.0.jar now doesn't create R8 warnings. Change-Id: I10f9bbf76bc8daec1ec470fb493e399d1beffc8a
2025-01-02Use implementation jar in IDEInfo Spandan Das
headerJar and implementationJar have the same classes and methods, but using implemetnationJar ensures that the jar is present in the intermediates directory after an `m $module` run. Bug: 384956156 Test: m android-support-fragment-nodeps out/soong/module_bp_java_deps.json Test: cat out/soong/module_bp_java_deps.json | jq '"android-support-fragment-nodeps"' Test: verified that the jar reported by the above command exists Test: m nothing --no-skip-soong-tests Change-Id: Ibd70c455b6bf12958b8f55d6c46ff2553a2f9d84
2024-12-11Split DepIsInSameApex into outgoing and incoming Colin Cross
Prepare for calling DepIsInSameApex from the apex transition mutator by splitting all the implementations in two, one that is called on the outgoing module and only takes the depTag, and one that is called on the incoming module and only takes the depTag. apexBundle.depVisitor was passing the child into android.IsDepInSameApex for both the parent and child paramters. The parent field was only used to find the type on which to call DepIsInSameApex, so this effectively used the child's implementation of DepIsInSameApex. That used to be necessary when the parent and child were of different module types, as the parent module type may not have been aware of the rules for the child module type, but is no longer necessary with split outgoing and incoming DepIsInSameApex. Bug: 372543712 Test: all soong tests pass Change-Id: If7c81ec3f7b1ea69d77e9ad7694e238820194e59
2024-12-03Change checkJavaStableSdkVersion to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I221f4ea7479d512d49cfb40a8cb06bba62ec2c7a
2024-11-20Collect aconfig files from *_libs in java_api_library Jihoon Kang
Aconfig files can be provided to java_api_library in two ways: 1. By specifying the aconfig_declarations module names in the aconfig_declarations property 2. By specifying the java_aconfig_library (or its static rdeps) module names in the libs/static_libs property 1. was behaving as expected for java_api_library, but 2. was not behaving as expected and java_api_library is erroneously not collecting the aconfig files from the libs/static_libs dependencies. This change fixes such broken behavior. Test: CI Bug: 379807097 Change-Id: I1d6d1fa4eae32b4f28e68c88e4e67b2ff7ae7805
2024-11-13Don't use echo -e Colin Cross
A rule that uses echo -e may execute in a dash shell instead of bash when running on the build servers. The dash echo builtin is posix compliant, and does not treat -e as an option[1]. Replace all uses of echo -e with echo if it does not need escape sequences, or printf if it does. [1] https://wiki.ubuntu.com/DashAsBinSh#echo Bug: 378931009 Test: manual Change-Id: I2974f59ea10a613bc3bd36e3591fd81f38a1769a
2024-11-07test_module_config for sh_test Ronald Braunstein
[retry reverted 45dca5c8cc538392edbde4ee1077fc86509b2e38 after rebase] Implemented test_module_config for sh_tests. There are some shell tests that have 130 cc_binaries and they get duplicated in the vts .zip. test_module_config allows deduping for lowmem and hwasan use cases freeing a 1 G in the zip. Moved some of the knowledge about constructing the make rules back to the provider. I haven't tried this for cc_test or rust_test, but I think it will be similar to sh_test if we ever need it. There is currently only one usecase for using test_module_config with sh_test (and none for cc_ or rust_) Also added "extra_test_configs" to sh_test Sample bp file. test_module_config { name: "vts_ltp_tmc", base: "vts_ltp_test_x86_64", test_suites: [ "general-tests", "vts" ], options: [ {name: "is-low-mem", value: "false"}, {name: "is-hwasan", value: "true"}, ], } Test: go test ./ Test: m vts_ltp_test_x86_64_hwasan Test: atest vts_ltp_test_x86_64_hwasan Test: m vts # inspect the zip for symlinks Test: CtsAppTestCases_android_server_am Test: atest -c -v vts_ltp_test_x86_64:vts_ltp_test_x86_64_hwa Change-Id: I208797f97e3448bcff7434630adfd7476fc275f9
2024-11-07Merge "Revert "test_module_config for sh_test"" into main Liana Kazanova
2024-11-07Revert "test_module_config for sh_test" Liana Kazanova
This reverts commit 45dca5c8cc538392edbde4ee1077fc86509b2e38. Reason for revert: DroidMonitor: Potential culprit for http://b/377964351 - 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: Idd5e4b0d04b3c04dc1cfc4541615fc5f42a85c3e
2024-11-07Merge "test_module_config for sh_test" into main Ronald Braunstein
2024-11-06test_module_config for sh_test Ronald Braunstein
Implemented test_module_config for sh_tests. There are some shell tests that have 130 cc_binaries and they get duplicated in the vts .zip. test_module_config allows deduping for lowmem and hwasan use cases freeing a 1 G in the zip. Moved some of the knowledge about constructing the make rules back to the provider. I haven't tried this for cc_test or rust_test, but I think it will be similar to sh_test if we ever need it. There is currently only one usecase for using test_module_config with sh_test (and none for cc_ or rust_) Also added "extra_test_configs" to sh_test Sample bp file. test_module_config { name: "vts_ltp_tmc", base: "vts_ltp_test_x86_64", test_suites: [ "general-tests", "vts" ], options: [ {name: "is-low-mem", value: "false"}, {name: "is-hwasan", value: "true"}, ], } Test: go test ./ Test: m vts_ltp_test_x86_64_hwasan Test: atest vts_ltp_test_x86_64_hwasan Test: m vts # inspect the zip for symlinks Test: CtsAppTestCases_android_server_am Test: atest -c -v vts_ltp_test_x86_64:vts_ltp_test_x86_64_hwa Change-Id: I5a36d798fd21180d653d09e54f40449a0ebcbd29
2024-11-06Merge "Target Java 21 by default" into main Sorin Basca
2024-11-06Merge "Verify that libraries in apexes don't link to implementations outside ↵ Colin Cross
the apex" into main
2024-11-05Verify that libraries in apexes don't link to implementations outside the apex Colin Cross
As part of removing some of the complexity in Soong around using stub vs. implementations for shared library dependencies a syntax will be added to Soong to allow explicitly selecting stubs vs. implementation. To avoid incorrect use, add a verification pass on apexes that ensure that all transitive implementation libraries used to link native libraries or binaries in the apex are themselves in the apex. Bug: 372543712 Test: TestApexVerifyNativeImplementationLibs Flag: EXEMPT host only Change-Id: I4aeaca00a359ce97e8f9efd2d8bffb8f9d2dc0df
2024-11-05Target Java 21 by default Sorin Basca
Bug: 342332820 Test: TH Change-Id: I3d440c79231cc470013610c8b3ec95a0b4a0cb6a
2024-10-31Distinguish HideFromMake from SkipInstall Spandan Das
Invoking HideFromMake today would also make the module uninstallable. This was a safe assumption since the packaging sytem was in build/make - if a module is not visible to make, it is also uninstallable. With the advent of soong packaging system, this might not always be true. This CL disentangles SkipInstall from HideFromMake. This CL also sets SkipInstall on modules where the installation rules should not be emitted, e.g. to prevent duplicate installation rules between platform and apex variants of libraries Test: m nothing --no-skip-soong-tests Test: no diff in aosp_cf_x86_64_phone's system file_list.txt Change-Id: I80cdd60d2ebdba22fd37e748eb00242cc412bda1
2024-10-30Merge "Revert "Add device_first_vendor(_shared)_data"" into main Cole Faust
2024-10-30Revert "Add device_first_vendor(_shared)_data" Cole Faust
This reverts commit a8bf946a22d5e7022c5fd2c748da226f0ee0a16e. Reason for revert: Replaced with aosp/3322568 Change-Id: Ided7e261d50fbc3e41d4d731ae86b69258b2e7a2
2024-10-28[Ravenwood] Support java_defaults for ravenwood properties John Wu
Test: m --no-skip-soong-tests nothing Bug: 292141694 Flag: EXEMPT host test change only Change-Id: Ide365dce9ff55ab07d304b10d660317c83f827fc
2024-10-24Add device_first_vendor(_shared)_data Cole Faust
There are some host tests in internal that rely on the vendor variation of other modules, that they include in their `data` property. Add explicit properties for these dependencies so that they don't rely on the 1-variant fallback. Bug: 372091092 Test: m nothing Change-Id: I51a50db2a06fdd3f885ac21f3ad3ce15386feb53
2024-10-24Merge changes from topic "move-depset" into main Colin Cross
* changes: Update DepSet references Move DepSet to blueprint Convert DepSet to a wrapper around a pointer
2024-10-24Update DepSet references Colin Cross
Update all references to depset to use blueprint/depset, and to use DepSet instead of *DepSet. Bug: 375276086 Test: all soong tests pass Flag: EXEMPT refactor Change-Id: I59a7836d0975366ddc336225fb770ac7e6e0c8ea
2024-10-24Remove testing package Cole Faust
The testing package defined test_spec and code_metadata module types, but they were never used and the owner left google. Bug: 372091092 Test: Presubmits Change-Id: I2d34ce173ec46483719a1d333180937b3da1fa04
2024-10-23Add device_first_prefer32_data to java modules Cole Faust
Some java host tests add data dependencies on `compile_multilib: "first_prefer32"` modules. In order to match that with the requested variations, add a device_first_prefer32_data property. Bug: 372091092 Test: m nothing Change-Id: I54d056cc864512b22ad3da882c807052344ac1ca
2024-10-22Merge "Add new properties to aid in removing the 1-variant fallback" into main Cole Faust
2024-10-21Add new properties to aid in removing the 1-variant fallback Cole Faust
These new properties are essentially methods to specify "outgoing transitions" in blueprint files. There are lots of host tests that want to include apps built for device in their data, so they need a property that adds dependencies based on the device variants instead of copying the same host variants. After this cl is submitted, I'll do an LSC to update all the usages that are relying on the 1-variant fallback to use these properties instead. Bug: 372091092 Test: m nothing --no-skip-soong-tests Change-Id: I45b8fb024da120ad61606e3a21de86e4392be2a4
2024-10-17Make uses_libs and optional_uses_libs configurable Cole Faust
Requested for the mk2bp conversion. Fixes: 373772769 Test: m nothing --no-skip-soong-tests Change-Id: I9a36e73f20c73e25b555fb3f0a074b30a548ae50
2024-10-17Skip `none` system_modules from module_bp_java_deps.json Spandan Das
`none` is not a soong module, and can be skipped. Test: go test ./java Test: verified that `none` no longer appears in deps of `android-non-updatable.stubs.from-text` Bug: 373837953 Change-Id: I3bf60b762a52f1b236dde8dd020aa291697939b2
2024-10-10Merge changes from topic "remove-non-parallel-mutator" into main Colin Cross
* changes: Remove MutatorHandle.Parallel() Fix TestFinalDepsPhase for parallel mutator
2024-10-10Remove MutatorHandle.Parallel() Colin Cross
All mutators are parallel by default, remove the explicit Parallel() calls. Bug: 372540665 Test: all soong tests pass Flag: EXEMPT refactor Change-Id: I41e3a71bd13c75b7fceae91b1c4cfe678ab62df2
2024-10-09Make java binaries common instead of common-first Cole Faust
Previously, java binaries had both common and the first arch variants. This was origionally added in aosp/556843. The reasoning there was so that a java binary could be used as the dependency of a genrule. However, now with transition mutators, we can make the incoming transition redirect the arch variant to the common variant if the module only has a common variant. This allows genrules to depend on the common arch variant easily. That change is also included in this cl. Bug: 372091092 Test: m nothing --no-skip-soong-tests Change-Id: Iea612d050bff608d661f81566884653239015213
2024-10-04Add JNI libs support to device variants of java_binary Spandan Das
This adds jni_libs support back to device variants, which was removed in https://r.android.com/3230584. These will be installed by the two packaging systems in different ways 1. Kati: By being listed in `LOCAL_REQUIRED_MODULES` of the autogenerated Android.mk 2. Soong: Via the`jniInstallTag`, whose `InstallDepNeeded` value is true This CL also makes it an error for a native library to be listed in `required` of a `java_binary(_host)`. Test: m nothing --no-skip-soong-tests Test: Verified that there are no diff in system_intermediates/file_list.txt (device variants) Test: m installclean && m <host_java_bin> ; verified that the jni library is installed in out/host/linux-x86/lib64 (host variants) Bug: 370110572 Change-Id: I6aebc648191ab39f2da15a5f2807d46abab22cb0
2024-09-30Merge "Make the java jni_libs property configurable" into main Treehugger Robot
2024-09-30Make the java jni_libs property configurable Jihoon Kang
Bug: 323382414 Bug: 370563864 Test: m nothing --no-skip-soong-tests Change-Id: I11d8350d338e44d27537c6e5529034ba8a38265c
2024-09-27Merge "Remove top down strict updatability checks" into main Colin Cross
2024-09-26Merge "Remove the SdkLibraryDependency interface" into main Treehugger Robot
2024-09-26Remove top down strict updatability checks Colin Cross
The enforce_strict_updatability_linting and apex_strict_updatability_lint are some of the last top down mutators, and removing them will help with incremental analysis. Both mutators are used to propagate a flag to transitive java dependencies that causes them to add extra checks to their lint rules to require that baselines not include any skipped NewApi checks. Instead of modifying dependencies to check the baselines, propagate the baselines up to the modules that are requesting the checks, and perform the checks on all transitive baselines there. Bug: 367784740 Test: TestJavaLintStrictUpdatabilityLinting Test: TestApexStrictUpdtabilityLint Flag: EXEMPT refactor Change-Id: Ief2e3b26d745da61f13e621d635a5879d9c56779
2024-09-26Merge "Use providers for lint" into main Colin Cross
2024-09-26Remove the SdkLibraryDependency interface Jihoon Kang
Instead, provide the information of the source/prebuilt java_sdk_library to the rdeps via the SdkLibraryInfoProvider. Test: m nothing --no-skip-soong-tests && diff ninja file Bug: 348040422 Change-Id: If6cd3cd260a8ce8dccead7f302840cabf68a9fae
2024-09-25Use providers for lint Colin Cross
Bug: b/348040422 Test: lint_test.go Flag: EXEMPT refactor Change-Id: I420bee2c7056a3f4acee3af5955f79c504ea61d9
2024-09-23Merge changes I0edb681b,I0ea2327f into main Spandan Das
* changes: Remove internal deapexer module Remove deapex support from java_*_import
2024-09-20Remove deapex support from java_*_import Spandan Das
prebuilt_apex/apex_set currently supports its deapexed contents to be returned via a sibling java_import/java_sdk_import module. This is necesssary for 1. dexpreopt/hiddenapi processing 2. usage as shared library (1) is no longer necessary. this information is provided by the top-level prebuilt apexes now (2) is no longer possible since `exported_java_libs` has been removed in https://r.android.com/3272110 This CL uses a hack for java_sdk_library_improt. Even though (1) is provided by the top-level apex, there are still some places where dexpreopt/hiddenapi processing visits the import modules. This CL uses a bogus path to make analysis work. If this bogus path gets used, there will be an error during ninja execution Test: go test ./apex Test: in internal lunch cf_x86_64_phone-next-userdebug (uses mainline prebuilts) Test: verified that file_list.txt is same Bug: 368337090 Change-Id: I0ea2327f648f0fc60e337b232f7265e140772ffd
2024-09-20Revert^2 "Restrict java_sdk_library in libs of java_import and droidstubs ↵ Jihoon Kang
modules" These are all remaining usages of "magic", which are being removed with this change. The follow up change will remove the "magic". Test: m nothing --no-skip-soong-tests Bug: 366069293 Change-Id: If432cdc6621ac00564e14acbaefca53db1723686
2024-09-18Align CLC add context behavior between java_sdk_library and its impl lib Jihoon Kang
This change allows the impl lib of java_sdk_library to call AddContext(...) instead of AddContextMap(...) and ensure that the behavior between the top level java_sdk_library and the impl lib is identical when creating the class loader context. Test: CI && ABTD Bug: 366572133 Change-Id: Ia0bc7558ca737fcd3ad4ed62b3190aa567aa103f