summaryrefslogtreecommitdiff
path: root/java/java.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 "Expand TestSuiteInfoProvider to all test modules" into main Treehugger Robot
2025-03-11Merge "Add a trace_references_from dex optimization property" into main Treehugger Robot
2025-03-11Expand TestSuiteInfoProvider to all test modules Cole Faust
Test suites have been historically only defined in the AndroidMk functions. But in soong-only builds, we don't run AndroidMk. It appears Colin already started making a TestSuiteInfo provider, but hadn't set it on all test modules yet. Expand it to all the test modules, and add export it to make so that make can check that it matches LOCAL_COMPATIBILITY_SUITES. Bug: 388850000 Test: m nothing Change-Id: Iee8959742117604fd560c95be60f3cb7cf3d9ae4
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-05More partial compile optimizations LaMont Jones
Add "disable_stub_validation" and "disable_api_lint" Bug: b/394154271 Bug: b/396345437 Test: manual Change-Id: I1dc2b52bb3bfc3275287c99dbc679290bfeece35
2025-02-26Convert tidyPhonySingleton, jdepsGeneratorSingleton and Yu Liu
genNoticeBuildRules to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7507a580e3533b01f552778a7815bcc43d301e23
2025-02-25Convert the following singletons to use ModuleProxy: Yu Liu
buildTargetSingleton exportedJavaDeclarationsLibrarySingleton javaFuzzPackager kytheExtractAllSingleton kytheExtractJavaSingleton kytheExtractRustSingleton lintSingleton logtagsSingleton makeVarsSingleton ndkAbiDiffSingleton ndkAbiDumpSingleton phonySingleton platformCompatConfigSingleton sdkSingleton Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I625ac8a209ca93755b2ba232202cfb44ecefde0a
2025-02-21Merge "Implement host_common_data property for cc, java, rust and sh test ↵ Colin Cross
modules" into main
2025-02-20Build proguard zips in soong-only builds Cole Faust
This builds the zips but doesn't dist them, I'll do that in a followup. Bug: 395160816 Test: Diffed proguard-dict.zip proguard-usage.zip and proguard-dict-mapping.textproto between soong and make Change-Id: Ic112427e4a2fdaf92a1d0a96d0f1c100b57be37a
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-19Merge "Change 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." into main
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-18Implement host_common_data property for cc, java, rust and sh test modules Colin Cross
Implement the host_common_data property that will copy a host common module into the test data directory. This property can be used to copy a custom Tradefed test runner jar alongside the test. Bug: 262397555 Test: TestHostCommonData Change-Id: Iacef0778254a3dda400c9e221f442c47d8db7b02
2025-02-18Install tradefed dynamic config file in soong-only builds Cole Faust
Make has this behavior where it will find a DynamicConfig.xml file in the same directory in the module and install it next to the main tradefed config file. Recreate that behavior in soong-only builds. https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/base_rules.mk;l=859;drc=6a8fff595ba4cbb87b7e124fd630f548c5c4e2cb Bug: 396761822 Test: SOONG_ONLY=true atest -m -c CtsNetTestCases -- --test-arg com.android.testutils.ConnectivityTestTargetPreparer:ignore-mobile-data-check:true Change-Id: I69f1c262200d62cc0d3c590b6adbeb401af63ab9
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-13Merge "Support DepIsInSameApex using provider." into main Yu Liu
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-12Move dists to GenerateAndroidBuildActions Cole Faust
So that we're not as make-focused by disting in MakeVarsProviders. Bug: 395184523 Test: Verified ninja files were unchanged (on both m nothing and m nothing dist) Change-Id: I5fd94754d644162b355722fbb1e1fd6f085345b9
2025-02-11Merge "Fix ninja_determinism_test CI breakage" into main Wei Li
2025-02-11Fix ninja_determinism_test CI breakage Wei Li
Bug: 394671084 Test: m nothing && md5sum out/soong/build.aosp_cf*.ninja, run twice and md5 hashes should be same Change-Id: I2aba876faac32dd6329da29a280fcb06f1270b50
2025-02-11Merge changes from topics "apex_transition_info", ↵ Colin Cross
"bcp_dependency_through_apex" into main * changes: Convert android.TransitionMutator to TransitionInfo Pass libraryToApex and apexNameToFragment mappings into CreateClasspathElements Convert apex transition tag to dependency on apex Add extra dependency from apex to bootclasspath fragments to modules Move prebuilt mutators earlier
2025-02-10Convert android.TransitionMutator to TransitionInfo Colin Cross
Use the ApexInfo instead of a string as the TransitionInfo for apex variations. This removes the need for apexInfoMutator, which is the last remaining top down mutator. This has a variety of ramifications. One is that it is no longer possible to add a dependency onto the apex variation of a module, as that would require constructing a matching ApexInfo. Instead, anything that wants to add a dependency on the apex variation has to depend on the apex instead, and get to the module by walking its transistive dependencies. Another ramification is that modules in apexes can no longer determine which apexes they are in (unless they set UniqueApexVariations so that each variation is in exactly one apex). This prevents some of the existing container violation checks from working after this CL, tracked in b/394955484. It also requires using unique variation names for the prebuilt and source dependencies of apexes, so the apex variations for dependencies of prebuilts now have a prebuilt_ prefix. Bug: 372543712 Bug: 394955484 Test: go test ./... Change-Id: I3d08aca1ac956ab0e343ec3f235a736cd93be0e1
2025-02-07Merge "Convert api.xml dist rules to Soong" into main Treehugger Robot
2025-02-08Convert api.xml dist rules to Soong Jihoon Kang
...from make to support dist'ing *-api.xml files in soong-only builds. Test: m droid dist --soong-only && ls out/dist/api.xml Bug: 395162087 Bug: 394365683 Change-Id: I98e92423a107d24b04e6f6f0f96c23c24de01fa5
2025-02-07Merge "Add java_genrule_combiner module" into main Treehugger Robot
2025-02-07Add java_genrule_combiner module LaMont Jones
This module is intended to combine an implemenation generated by java_genrule with headers from the rule's inputs. Bug: b/285975842 Test: manual, TH Change-Id: I9d83634ad7fa56fe5e0a6363d2891d34ac58257e
2025-02-06Remove configurable values from providers Cole Faust
Providers are data exported from one module to another. Configurable properties are the collection of all possible values of a property, to be resolved under the module's configuration. If you export a configurable from one module to another and then resolve it there, it will be evaluated with the wrong configuration. Bug: 394967253 Test: m nothing Change-Id: I934b08538bcc3267b3ec44925591f16a1c59292c
2025-02-04Merge changes I5057c2cc,I83ac66c6 into main Treehugger Robot
* changes: Fixes for missing rules in m --soong-only Install intermediate file in testcases
2025-02-04Merge "Move installation of dexpreopted system server classpath libraries ↵ Colin Cross
into apex" into main
2025-02-04Install intermediate file in testcases Spandan Das
ctx.InstallFile adds the source file to checkBuildFiles. This causes issues if the module is an unexported namespace, since the installation files will not be created. Additional context: https://android-review.git.corp.google.com/c/platform/build/soong/+/3474792/comment/40af1b92_5e65d152/ Test: m nothing --soong-only Test: go test ./java Change-Id: I83ac66c6a81c8163a24acd4e9ef8aab0982e5e4c
2025-02-04Do not propagate uses lib tags of framework Jihoon Kang
framework is a bootclasspath library, thus its uses library tags collected from its dependencies should not be propagated to its reverse dependencies. This change utilizes the fact that `sdkLibTag` is only used to add "framework" and "res" as dependencies for java modules that set `sdk_version` (i.e. sdk_version "private"), and ensures that uses lib tags are not collected for `sdkLibTag` dependencies. Test: CI && ABTD Bug: 383045647 Change-Id: Idcd9f8d8b131a7ceb28b505fe865d5ac74d51a01
2025-02-03Move installation of dexpreopted system server classpath libraries into apex Colin Cross
System server jars in apexes currently use a heuristic to determine whether or not they are the "main" variant in order to create rules that copy their dexpreopt artifacts to the final installed location and their dex jars to a known location for other modules to reference. The heuristic depends on knowing all apexes that depend on the module, which will not be possible when the apex info mutator is rewritten to support future incremental analysis. Instead, export the dexpreopt artifacts and dex jars, and let the apex decide whether or not to install them. Bug: 372543712 Test: all soong tests pass Change-Id: I478bc2edceca4614e08e9a695b05d091e5437ba1
2025-01-30Add compliance metadata of java modules Wei Li
Bug: 330949782 Test: m compliance-metadata.db Test: build/soong/tests/sbom_test.sh Change-Id: I70b55caf2c38980f563170a68bcdb065f60f2461
2025-01-29Merge "Install java_test module test deps and configs in soong-only" into main Treehugger Robot
2025-01-29Install java_test module test deps and configs in soong-only Jihoon Kang
This change installs test deps and configs to the `testcase/` directory for atests use in soong-only builds. Bug: 391924360 Test: locally set PRODUCT_SOONG_ONLY && m clean && atest signature-host-tests Change-Id: I6655c2903c2f62c65ff0056b0dbe542df48e3e49
2025-01-29Merge "Convert sdk_library to use ModuleProxy." into main Yu Liu
2025-01-29Merge "Pass --api-surface to Metalava" into main Treehugger Robot
2025-01-28Convert sdk_library to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Ifa759a5894c55a2a1485b61fb6752a74df589aec
2025-01-28Convert robolectric_test's module-info.json to song Cole Faust
This produces this diff, which I beleive is beneign: https://paste.googleplex.com/4846726910050304 Bug: 389720048 Test: diff'd module-info.json Change-Id: I531644d208a0a9d0fb2166d158f77e671554e5d8
2025-01-28Convert java modules' module-info.json to Soong Jihoon Kang
This change converts the module-info.json of java_library and other java modules that call java_library's GenerateAndroidBuildActions() in its GenerateAndroidBuildActions() to Soong. Bug: 389720048 Test: Inspect module-info.json diff, CI Change-Id: I0db5ae3a5fb41bb60dc538aea2d8e614c9ae23d4
2025-01-27Pass --api-surface to Metalava Paul Duffin
Uses the `api_surface` property and passes it down to Metalava. It will use it to select the appropriate `<api-surface>` configuration in `build/soong/java/metalava/main-config.xml`. Bug: 391554590 Test: m checkapi Change-Id: I5ec4e121239e6ecbc4dc1b2958a164f93bb8b437
2025-01-27Add core-platform-legacy to supported api surfaces Paul Duffin
This is needed because `external/icu4j` creates two versions of the `core-platform` API, one containing stable APIs and one containing legacy APIs. It is not clear exactly what the difference is but as they pass different `--show*-annotation` options to Metalava they need to have their own `<api-surface>` element in the configuration. Bug: 391554590 Test: m checkapi Change-Id: Ie02abd17a289261fe47bfb9f2da0ca472f065d0d
2025-01-24Allow java_sdk_library to override the droidstubs api_surface per scope Paul Duffin
Previously, every `java_sdk_library` would create a `droidstubs` module passing in the name of the `apiScope` as the `api_surface` property. e.g. the `public` scope was always called `public`, etc. While that works for the vast majority of `java_sdk_library` modules there are a few in `libcore`, `external/conscrypt` and `external/icu` which create `public` scope APIs but which are not actually `public`. e.g. libcore creates `intra-core` APIs, conscrypt and icu also create `core-platform` APIs. They are different from `public` in the annotations that they pass to Metalava. A future change will pass the `api_surface` property down to Metalava and that will be used to retrieve a corresponding configuration from `build/soong/java/metalava/main-config.xml`. That configuration will include the annotations. Therefore, each set of annotations that are passed will need a unique name. This change allows the `api_surface` for the default `public` scope to be overridden to select the correct `api_surface` in the configuration. Bug: 391554590 Test: m checkapi Change-Id: Iaa2c8325f0ffae2daf77201abe4e77c919528ad3
2025-01-21Merge "Convert JavaFuzzTest, JavaLibrary, ↵ Yu Liu
generateAndroidBuildActionsWithConfig, ravenwood and robolectricTest to use ModuleProxy." into main
2025-01-17Update java_defaults to support android_app_import properties Herbert Xue
Bug: 390090292 Test: presubmit Change-Id: I94c1a7838012672b12e28e687cd3ddff4d5e01d2
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