summaryrefslogtreecommitdiff
path: root/java/base.go
AgeCommit message (Collapse)Author
2025-03-19Use d8 when on eng builds LaMont Jones
This is consistent with all of the other ways that eng builds are faster, but do not match the expected performance of user or userdebug builds. We still use r8 if a module has `optimize: { enabled: true,}`. Bug: b/374975543 Test: manual, TH Change-Id: I28c6de4472f4df1f791758294d45b67acc0a7b7c
2025-03-13Change CommonModuleInfoProvider to a pointer. Yu Liu
Bug: 358427516 Test: Manually verified genereated ninja and mk files, unit tests. Change-Id: I53a6dd718232735decbeb93febfd269dd9449e86
2025-03-11Merge "Add a trace_references_from dex optimization property" into main Treehugger Robot
2025-03-11Add a trace_references_from dex optimization property Jared Duke
Introduce a new property `trace_references_from` in the optimize block. This field allows specifying a set of downstream targets from which to trace references when optimizing the current target. In practice, this requires explicit breaking of any cycles that might occur. A follow-up effort will explore doing this dynamically and implicitly for `libs` references onto an optimized target that enables this feature. Bug: 212737576 Test: m nothing Test: go test ./java Flag: EXEMPT bugfix Change-Id: I088bd8bf89403661a084a43b2822a6efbbc0294d
2025-03-07Rename CommonModuleInfoKey to be consistent with others. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I1ce8bc782666586633ded9cfaf1b9590e3c0efde
2025-03-07Revert "Put manifest in header jars" Pechetty Sravani (xWF)
Revert submission 3527753 Reason for revert: <Droidmonitor created revert due to b/401440477.Will be verified through ABTD for standard investigation.> Reverted changes: /q/submissionid:3527753 Change-Id: I6d43edd7370dc2d5f0db44615909353e4116da73
2025-03-05Put manifest in header jars Colin Cross
The kotlinx.serialization kotlin plugin reads the manifest of the kotlinx.serialization runtime header jar. Insert the manifest into header jars. Bug: 363909427 Test: kotlinx_serialization_core_tests Change-Id: I89007b5a8667ebbd3cc7409731001d97ae4b6f95
2025-02-20Remove RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH Colin Cross
RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH is set to true in all release configs in main, Soong can stop checking the value. This implicitly enables the flag for all of the tests in Soong, which requires updating paths in many of them. Test: builds Change-Id: I2e0d6cd109e1aa7a1163116fa1210e3f42f57878
2025-02-19Change depVisitor to use providers instead of type-asserting to Yu Liu
interfaces directly, the next step is to change it to use ModuleProxy once IsDepInSameApex is ready. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I13a4e256a26dbf7f9b3b746d628ac8f68b4e598e
2025-02-13Convert CheckMinSdkVersion to use providers. Yu Liu
Next step is to convert it to use ModuleProxy once IsDepInSameApex is converted to use providers. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I20cb052666fa95eb964e63e3302ac892d3324183
2025-02-13Support DepIsInSameApex using provider. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I8ec5e8a3a06d078602ebaa902cacb70987f1deda
2025-02-11Optimize getJarJarRuleText Colin Cross
getJarJarRuleText accounted for 10% of all allocations in Soong totalling 10 GB due to repeated string growth. Use a StringBuilder instead. Test: builds Change-Id: I4bce338d161cb2f9c0aba1036ced55d2e8ee6b14
2025-01-22Merge "Always include the header jar file. The header jar file is used by ↵ Ilshat Aliyev
JavacTool in Cider-G to resolve dependencies when producing diagnostics." into main
2025-01-22Always include the header jar file. The header jar file is used by JavacTool ↵ Ilshat Aliyev
in Cider-G to resolve dependencies when producing diagnostics. Bug: 383594831 Change-Id: I945469aa13dc40b85578fd21792908f39415d8fc
2025-01-22Change android over to Kotlin 2 by default Dave Mankoff
Fixes: 383569207 Flag: KOTLIN_LANG_VERSION Test: m && presubmits Change-Id: Ifeff06a71048e362a86d3563e513b8138093d8af
2025-01-21Merge "Convert JavaFuzzTest, JavaLibrary, ↵ Yu Liu
generateAndroidBuildActionsWithConfig, ravenwood and robolectricTest to use ModuleProxy." into main
2025-01-17Merge "Add note about kotlin_lang_version" into main Treehugger Robot
2025-01-17Convert JavaFuzzTest, JavaLibrary, Yu Liu
generateAndroidBuildActionsWithConfig, ravenwood and robolectricTest to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Icafbef242f78e1c7b186fc7e642bb1cf514e3cc2
2025-01-15Convert AndroidLibrary.GenerateAndroidBuildActions, Yu Liu
ApiLibrry.GenerateAndroidBuildActions, Binary.GenerateAndroidBuildActions and collectDepProguardSpecInfo to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I2d9a09ee6797d9cb2a7d696571784fcfcea7aff7
2025-01-15Convert collectDirectDepsProviders, collectTransitiveSrcFiles and Yu Liu
r8Flags to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Ib3d45c317e1f2669808d0c785454fb8d8fb9cd3b
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-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-10Merge changes Ie937a236,I74e6ebef,Ib8020db0 into main Yu Liu
* changes: Convert hasCode and aaptLibs to use ModuleProxy. Convert validatePartitionType and checkJniLibsSdkVersion to use ModuleProxy. Convert getLibsForLinkerConfig to use ModuleProxy.
2025-01-10Add note about kotlin_lang_version Dave Mankoff
Bug: 383569207 Flag: EXEMPT comment only Test: comment only Change-Id: Ic8145c09d9016ae3210b7b26fb97fe9ffd434e34
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-09Add kotlin-lang flag. Dave Mankoff
This allows targets to choose whether they compile with kotlin 1.9 or kotlin 2 Bug: 383569207 Flag: EXEMPT this is a flag itself Test: built system image Change-Id: I1228ed1d8a5f9d6029261e4a867a2301069e315f
2025-01-03Remove RenameUse struct from JarJarProvider Jihoon Kang
The struct is not utilized anywhere in the build. Test: m nothing --no-skip-soong-tests Change-Id: I0dac2b56b82dc5aa2fb7193b2aec54c6b16aa449
2024-12-18Remove source_file_provider.go after it's last usage was removed. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Iff10448dc4dda49e1f02258a4c113db75778a95d
2024-12-12Support jarjar sharding Makoto Onuki
- If the new option `jarjar_shards` is set, use this as the number of shards and enable sharding. - The plan is to use it on "big" jars such as framework-minus-apex, but for now, we only use it in a "test" target, `framework-minus-apex_jarjar-sharded`. - Also add `framework-minus-apex_jarjar-sharded` to the various hardcoded spacial cases. Test: m framework-minus-apex framework-minus-apex_jarjar-sharded and make sure the javac output jars have the same entries. $ diff \ <(jar tf $ANDROID_BUILD_TOP/out/soong/.intermediates/frameworks/base/framework-minus-apex/android_common/jarjar/framework.jar \ | sort) \ <(jar tf $ANDROID_BUILD_TOP/out/soong/.intermediates/frameworks/base/framework-minus-apex_jarjar-sharded/android_common/jarjar/framework-minus-apex_jarjar-sharded.jar \ | sort) (no output) Bug: 383559945 Flag: EXEMPT New options are not used on production jars Change-Id: I94c2ad978add25267f22b65c063e9148901b208b
2024-12-11Add the ability to always run errorprone inline Cole Faust
Currently, if you enable RUN_ERROR_PRONE=true, we create a seperate jar from the main build which runs errorprone. But errorprone builds also produce a regular built jar as a side effect, so you could use it as your main java builder action. We don't do that because if you toggled errorprone on/off, you'd invalidate all the java builds. However, on CI, we always run with errorprone on, so there, it makes more sense to always do the inline builds so that you don't have to build everything twice. Add a new environment variable to control running errorprone inline or not. Bug: 383626679 Test: Presubmits Change-Id: I262af140fdeacb8342fe801f0c86f516d8fca587
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-10Convert checkApexAvailability to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7582db8e22e94d0a9db7715a76bb6ed34c166a4e
2024-12-06Merge "Change compose Compiler. New Soong Exclude_common_Srcs." into main Dave Mankoff
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-18Merge "Don't use DirectlyInAnyApex to enable dex and coverage" into main Colin Cross
2024-11-16Don't use DirectlyInAnyApex to enable dex and coverage Colin Cross
DirectlyInAnyApex was being used to automatically enable dexing and to enable coverage. There is only one module in an apex that isn't already being dexed, so set compile_dex in that module and remove the automatic dexing. Coverage is only useful on device modules if they are dexed, so convert the shouldInstrumentInApex test to check if it is dexed instead. This reomves the last usages of DirectlyInAnyApex from the java package. Bug: 372543712 Test: No change to build.ninja Change-Id: I1d1738305ed97d85669945def75e9916c2b41f3c
2024-11-16Merge "Deny nil outputpaths" into main Treehugger Robot
2024-11-15Deny nil outputpaths Cole Faust
To prevent nils from permeating the rest of the codebase. Bug: 379329165 Test: m nothing --no-skip-soong-tests Change-Id: I3e789b6af0f101cf4bc0bd4666bf3a443f2f2c84
2024-11-13Only coverage instrument device modules that are being compiled to dex Colin Cross
There's no reason to instrument device modules that are not being compiled to dex with jacoco, as they can't be installed on the device if they only have class files, and modules that depend on it will get the pre-instrumented jar. Bug: 372543712 Test: TestCoverage Change-Id: I10d5fb2eeb1f1acf6393603b5219685bf22f327c
2024-11-01Change compose Compiler. New Soong Exclude_common_Srcs. Dave Mankoff
Default the kotlin compiler to use language-version 1.9, as the kotlin compiler is being upgraded to 2.0.21, but not all of the code yet compiles with 2.0. Test: m Bug: 369137871 Change-Id: I1539860eaa39c858fe6f327a434a2e93f4e05018
2024-10-29Make java_resources configurable Cole Faust
Requested by a user. Fixes: 376187263 Test: m nothing --no-skip-soong-tests Change-Id: I152f5ff766724a2dff2b5934f44ac81e9389befa
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-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-18Merge "Add support for kotlin plugins" into main Treehugger Robot
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-17Add support for kotlin plugins Luca Stefani
Use the already existing hooks used by the compose compiler plugin to support kotlin plugins bundled alongside the compiler such as kotlin-serialize-compiler Test: m, sample app with kotlin-serialize-compiler Change-Id: I4d5fa6cd42acfc90ef437222e9e07f61c259d565
2024-10-08Add srcs of jarjar'd java libs back to module_bp_java_deps.json Spandan Das
For language feature support. Test: build/make/tools/ide_query/ide_query.sh --lunch_target=aosp_cf_x86_64_phone-trunk_staging-eng frameworks/base/core/java/android/app/Activity.java Test: go test ./java Bug: 372192486 Change-Id: I9b66bb0bdb576ac3f1757591b2bbef965602f740