summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2024-05-15Revert "Install transitive deps of jni libs, but not the jni libs themselves" Jiyong Park
This reverts commit e7168070832a9a849007c9e63cd3cd827d1904e4. Change-Id: If3b63706114cb534af359fdac2d80d8a5d02ea6d
2024-05-10Install transitive deps of jni libs, but not the jni libs themselves Jiyong Park
Consider this case: app --(jni_libs)--> libfoo --(shared_libs)--> libprivate Only libfoo is embedded into the app. libprivate is not embedded because libprivate is very likely to be depended on by other components in the platform, in which case it will anyway be installed to /system/lib. Embedding libprivate into the app will increase the storage usage as a whole. Furthermore, if libprivate is not a shared lib but a config file (of type prebuilt_etc), it can't be embedded and therefore must be installed outside of the app. However, a problem occurs when libprivate is not depended on by anyone else. Then libprivate is not installed to the system partition, causing an error at runtime. This CL fixes that by making the jni_libs dependency to implement the new SKipToTransitiveDepsTag interface. Now, jni_libs themselves are not installed, but their transitive deps are depended on by the app containing the jni libs. Bug: 330276359 Test: m NfcNci and check if libnfc-nci.config is installed. Test: m CarService and check android.hardware.automotive.evs-V2-ndk.so is installed as well. Test: go test ./... under soong/java Change-Id: I04cc92b7fad768a20ec60a02b3e7534641b1e74d
2024-05-08Merge "Revert^2 "Remove compilation actions from java sdk library"" into main Treehugger Robot
2024-05-08Revert^2 "Remove compilation actions from java sdk library" Jihoon Kang
This change modifies the build actions of java_sdk_library module type so that it does not perform any compilation actions (i.e. does not create the top level java_sdk_library jar file). Instead, it delegates the build actions the top level jar file was performing to the dynamically created ".impl"-suffixed java library module. The build actions that are delegated to the impl library module include hiddenapi processing, dexing, and dexpreopt. This change relands https://r.android.com/3035972. Implementation changes from the original change: - "all_apex_contributions" is added as a dependecy to the implementation library modules where the parent sdk_library module has a prebuilt equivalent. This allows the source apex variant to be hidden from make when the prebuilt is active. Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing Test: m nothing --no-skip-soong-tests Bug: 332785297 Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257
2024-05-07Merge "Revert "Remove compilation actions from java sdk library"" into main Jihoon Kang
2024-05-06Revert "Remove compilation actions from java sdk library" Jihoon Kang
Revert submission 3070882-sdk_lib_remove_compilation Reason for revert: Potential culprit for build breakage of barbet-ap2a-userdebug in git_main Reverted changes: /q/submissionid:3070882-sdk_lib_remove_compilation Change-Id: I5135760e13e0152480c68fe91a3c88564e9bc7cb
2024-05-06Merge "Remove compilation actions from java sdk library" into main Treehugger Robot
2024-05-03Remove compilation actions from java sdk library Jihoon Kang
This change modifies the build actions of java_sdk_library module type so that it does not perform any compilation actions (i.e. does not create the top level java_sdk_library jar file). Instead, it delegates the build actions the top level jar file was performing to the dynamically created ".impl"-suffixed java library module. The build actions that are delegated to the impl library module include hiddenapi processing, dexing, and dexpreopt. Test: m nothing --no-skip-soong-tests Bug: 332785297 Change-Id: I7534f9eaacf6d9f72fbf8d540b1e26af84106c20
2024-04-29Merge logtags from cc modules too Inseob Kim
Merged logtags files will be used for Soong built filesystem images. Bug: 336189540 Test: m out/soong/.intermediates/all-event-log-tags.txt Test: m out/target/common/obj/all-event-log-tags.txt Change-Id: Ib590c2bc8073e9acee6b45ef08092768237cf9d3
2024-04-22Merge "Add Java 21 as a known version" into main Sorin Basca
2024-04-19Add Java 21 as a known version Sorin Basca
Bug: 335612268 Test: Set java_version to 21 in core-all && m Change-Id: Ie2093187cec75949ae3bb4903edfb6f62aa31f6e
2024-04-18Merge "Allow dexpreopt of source sdklib in prebuilt apex builds" into main Treehugger Robot
2024-04-17Allow dexpreopt of source sdklib in prebuilt apex builds Spandan Das
aosp/2984037 disabled dexperopt of the source apex system server jars when prebuilts are selected. This was done to prevent duplicate installation and dex2oat deps. AOSP art has some additional variants like com.android.art.debug. In source builds, this apex should contain service-art.jar and service-art.jar.prof (a dexpeopt artifact). We have a test to check this (`art_apex_test.py`). If we disable dexpreopt of source sdlib when prebuilts are selected, this test needs to be disabled. This is the behavior at ToT. This CL changes the behavior to enable running this test even when com.google.android.art prebuilt is active in a specific release configuraiton. To prevent collisions that prompted aosp/2984037, this CL special-cases the installation and dex2oat rules instead of disabling dexpreopt of the source sdklib altogether. b/331665856 tracks the principled solution to prevent duplicate dexpreopt rules. Implementation: Add a new copyApexSystemServerJarDex arg to GenerateDexpreoptRule API. If true, the dexjar file will be copied to out/soong/system_server_jars/. For soong modules, the value of this will be the inverse of disableSourceApexVariant. Since none of the apex system server jars are in make, this will be a noop in dexpreopt_gen Bug: 331665856 Test: modified trunk_staging.scl locally to select art.google.contributions.prebuilt; mmma art; (with the sibling CL in topic) Change-Id: Idb59e424f83d126cdc8b1671dde358745979bd8d
2024-04-16Merge changes from topic ↵ Treehugger Robot
"cherrypicker-L27000030003160683:N90900030051335582" into main * changes: Propagate transitive missing optional_uses_libs. Refactor the contruction of the manifest check inputs.
2024-04-15Propagate transitive missing optional_uses_libs. Jiakai Zhang
Bug: 331528424 Test: m --no-skip-soong-tests Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged. Merged-In: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0 Change-Id: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
2024-04-15Refactor the contruction of the manifest check inputs. Jiakai Zhang
This is a no-op change for a majority of cases. Before this change, the contruction of the manifest check inputs is confusing. It mutates uses_libs properties in place just for the manifest check, by replacing module names with library names for direct dependencies and merging library names from CLC for both direct denpendencies and transitive denpendencies, and then constructs manifest check inputs from those mutated uses_libs properties. This is error-prone and leads to insistency: the goal is to check that the CLC matches the manifest, but the inputs to the check don't reflect the CLC. After this change, we no longer mutate uses_libs properties in place. Instead, we maintain a separate list of missing denpendencies, and then construct manifest check inputs directly from the CLC for all existing libraries, no matter they are direct or transtive, and from the separate list of missing libraries. This change makes the logic more consistent and straightforward, and it also allows us to easily do the next change, which is to propagate transtive missing denpendencies. In fact, this change revealed several bugs around library optionality and order in CLC construction, and fixed them. Bug: 331528424 Test: m --no-skip-soong-tests Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged. Merged-In: I0de82e76c47995b54aba9efd41538d950256a95f Change-Id: I0de82e76c47995b54aba9efd41538d950256a95f
2024-04-12Add "test-only" flag for java modules Ronald Braunstein
As part of aosp/3022586 where we added the idea of "test-only" modules and top_level_test_targets, this CL implements that for java modules. We let users set "test-only" on java_library, but not on other modules where the module kind is implicitly test-only, like java_test. The implementation, not the user decides it is test-only. We also exclude it from java_defaults. % gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind' +--------------------------+----------+ | teams.kind | count(*) | +--------------------------+----------+ | android_test | 1382 | | android_test_helper_app | 1680 | | java_fuzz | 5 | | java_test | 774 | | java_test_helper_library | 29 | +--------------------------+----------+ % gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true and teams.kind not like "%cc_%" group by teams.kind' +--------------+----------+ | teams.kind | count(*) | +--------------+----------+ | android_test | 1382 | | java_fuzz | 5 | | java_test | 774 | +--------------+----------+ Test: m nothing --no-skip-soong-tests Test: go test ./java Test: m all_teams Bug: b/327280661 Change-Id: I9c3ad947dc3d68d6427abada27449526d69daa6b
2024-04-12Merge "Strip relative paths from java_import output files" into main Treehugger Robot
2024-04-11Strip relative paths from java_import output files Colin Cross
androidx.annotation_annotation is used as a test data file, and converting it from a java_library to a java_library_import causes the relative path used in the test data path to change. Clear the relative path in java_import the same way that other java based modules do. Bug: 288358614 Test: TestJavaLibraryOutputFileRel Change-Id: I1f494110da32e916043ca94ac6ebeeafccc06f9a
2024-04-09Merge "Add secretkeeper-v1-java to platform APIs" into main Nikolay Elenkov
2024-03-29Merge "Add test_module_config_host" into main Ronald Braunstein
2024-03-28Add test_module_config_host Ronald Braunstein
This pairs with `test_module_config` but also works on the base is a `java_test_host` module. e.g. test_module_config_host { name: "CtsOsHostTestCases_DERIVED_2566", base: "CtsOsHostTestCases", test_suites: ["general-tests"], include_filters: [ "android.os.cts.StaticSharedLibsHostTests" ], exclude_annotations: [ "androidx.test.filters.FlakyTest","org.junit.Ignore" ], } The new module is composed of the previous and shares much of the same code. With respect to build size, Without this change, if you build CtsAppSecurityHostTestCases, there will be several copies of the jar (and related apks) : *) 1 in framework out/host/linux-x86/framework/CtsAppSecurityHostTestCases.jar *) 1 in testcases for the test out/host/linux-x86/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar *) 1 per compatibility suite testcases out/host/linux-x86/mts-documentsui/android-mts-documentsui/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar out/host/linux-x86/mts-mediaprovider/android-mts-mediaprovider/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar out/host/linux-x86/mts/android-mts/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar out/host/linux-x86/cts/android-cts/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar out/host/linux-x86/mts-mainline-infra/android-mts-mainline-infra/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar A dervived test using CtsAppSecurityHostTestCases as base adds one more to its testcases dir: *) derived testcase. out/host/linux-x86/testcases/CtsAppSecurityHostTestCases_presubmit_ExternalStorageApp/CtsAppSecurityHostTestCases.jar Fixes: b/327280990 Test: m clean && m CtsOsHostTestCases_DERIVED_2566# as above Test: atest CtsOsHostTestCases_DERIVED_2566 --collect-tests-only Test: migrated the 71 TestMapping instances to Android.bp and build them. Ran tests on some of them. Ran some original `test_module_config` tests derived from `android_test` as well TODO: Add actions to validate the given filters are valid for the given test apks/jars. Change-Id: I115eedb6ff6ba8e72bb49e71867daf49d25ca0f1
2024-03-27Add secretkeeper-v1-java to platform APIs Nikolay Elenkov
Bug: 324321147 Test: Manual -- trigger factory reset, confirm ISecretKeeper.deleteAll() is being called in Trusty logs. Change-Id: If793f784bc1a8c621a721d15da9aeb1ef11e7334
2024-03-23Revert^2 "Support static_libs for java_import modules" Colin Cross
c6c9c7354bb9c8b8e69f21141e79d682bbe51076 Change-Id: Id011aca133d7bb45023a63c0f53d84a4d694cc2f
2024-03-22Merge changes from topic "revert-3008874-OJOKRLYEZJ" into main Colin Cross
* changes: Revert "Support transitive dependencies through android_libary_i..." Revert "Support static_libs for java_import modules"
2024-03-22Revert "Support static_libs for java_import modules" Colin Cross
Revert submission 3008874 Reason for revert: b/330903911 Reverted changes: /q/submissionid:3008874 Change-Id: I34cca9d021d9c806e28bb6a6a6da78efd61cde27
2024-03-22Merge changes from topic "no_more_nodeps" into main Colin Cross
* changes: Support static_libs for java_import modules Support transitive dependencies through android_libary_import modules
2024-03-21Support static_libs for java_import modules Colin Cross
Remove the need to wrap java_import modules with a java_library just to include static dependencies. Bug: 288358614 Test: TestJavaImport Change-Id: I888aecc6c0efc696a397fc1dd5d0ef5fd644bebc
2024-03-21Merge "Export JavaBootLibsSdkMemberType and ↵ Treehugger Robot
JavaSystemserverLibsSdkMemberType" into main
2024-03-20Export JavaBootLibsSdkMemberType and JavaSystemserverLibsSdkMemberType Spandan Das
build/soong/sdk will use these tags to differentiate the sdk and non-sdk contents of bootclasspath and systemserverclasspath fragments. Test: go build ./java Bug: 326246905 Change-Id: Ia8352c09fcbbca06988eb57153e5986801eb45a5
2024-03-20Merge "Change java stem attribute for both device and host" into main Treehugger Robot
2024-03-19Propagate intermediateCacheFiles in java modules and filegroup Jihoon Kang
This change propagates the intermediateCacheFiles generated by the aconfig_declarations to the static rdeps that are java modules or the rdeps that are filegroups. Test: m nothing Bug: 329284345 Change-Id: I02431336c1aa0378d03248f3bb6edf2f57ec3b7f
2024-03-19Change java stem attribute for both device and host yangbill
Bug: 329762127 Test: cd build/soong/java ; go test -run TestJavaLibHostWithStem Test: cd build/soong/java ; go test -run TestAppStem Test: cd build/soong/java ; go test -run TestAndroidAppImport_ArchVariants Test: cd build/soong/java ; go test -run TestOverrideAndroidAppStem Test: cd build/soong/java ; go test -run TestOverrideAndroidApp Test: cd build/soong/java ; go test -run TestPackageNameOverride Change-Id: I8fbdc82116f9a0c68121fbbeb1ef4f78f2b6fea3
2024-03-14Merge "Validate aconfig libs are built with the correct modes." into main Yu Liu
2024-03-12Merge "Use uncompressed dex for all preopted system targets" into main Treehugger Robot
2024-03-07Validate aconfig libs are built with the correct modes. Yu Liu
Bug: 323071835 Test: Unit tests and manual tests. Change-Id: I32de90826c7c8bb4d8495608e959d554820ab9a2
2024-02-28Enable non-"everything" stubs generation in java_api_library Jihoon Kang
This change adds support to generate non-"everything" (i.e. "runtime" and "exportable") stubs in java_api_library, which generates the stubs from the api signature files. Unlike droidstubs module that generates "everything", "exportable" and "runtime" stubs in a single module, java_api_library generates a single set of stubs per module, which is set by the default-"everything" property `stubs_type`. This is because java_api_library is responsible for both generation and the compilation of the stubs srcjar, and compilation of the stubs srcjar are done in separate java_library modules for from-source stubs. Utilization of this feature will be done in a follow up change that generates the "exportable" java_api_library modules in java_sdk_library. Test: m nothing --no-skip-soong-tests Bug: 318009570 Change-Id: I1051544ac3bcdb3ba1f78bfec28eba4e9fad9c2d
2024-02-20AOSP platform_apis violations Spandan Das
This allowlist contains java_library modules which set the no-op property `platform_apis`. This allowlist will help enforce that there are no new violations. This should be a no-op till https://android-review.git.corp.google.com/c/platform/build/soong/+/2969451 is submitted Test: presubmits Bug: 215379393 Change-Id: I49372e1d476201f607cd717be26aa3909668ff26
2024-02-20Merge "Disable dexpreopt if optional_uses_libs does not have an impl" into main Spandan Das
2024-02-16Disable dexpreopt if optional_uses_libs does not have an impl Spandan Das
At ToT, an optional_uses_libs is not added to the build time CLC if it does not exist in the tree. One edge case here is java_sdk_library_import, which might exist in the tree, but without an implementation. This cause issues during analysis when we try to verify the correctness of the build time CLC. This CL disables dexpreopt if a dependency does not have an implementation. To limit inadvertent side effects, this is restricted to java_sdk_library(_import) module types. (more precisely, it is restricted to java_sdk_library_import, since the source module type will always have an impl) Bug: 315802285 Test: Added a unit test Test: m nothing Test: printf debugging in internal main, verified that this CL does not disable dexpreopt on any android app inadvertently Change-Id: I173fc2f3ff654fe4091e9a43322164afd3222ee7
2024-02-13Introduce library property is_stubs_module Jihoon Kang
is_stubs_module property signifies whether the module compiles stubs or not. The information is propagated to the reverse dependencies of the java_library/java_sdk_library modules via JavaInfoProvider as StubsLinkType, a ternary state that provides information about whether the provided jars are compilation of stubs or implementation, or unknown. When java_sdk_library sets StubsLinkType, its state is Unknown as the decision of providing stubs vs implementation jar differs by the reverse dependency. Note that this CL does NOT propagate the property up to its reverse dependencies. This will be done in follow up CLs. Test: m nothing Bug: 310504781 Merged-In: Ic81488dbd1c9af1b5d31a33e5e9441d9f1416dbe Change-Id: Ic81488dbd1c9af1b5d31a33e5e9441d9f1416dbe
2024-02-09Use uncompressed dex for all preopted system targets Jared Duke
Extend default use of uncompressed dex for non-privileged system apps that are preopted. This avoids unnecessary disk usage on the /system_other/ partition, as well as the marginal overhead of extraction after mainline updates. In total, this saves ~5-15MB cumulatively across partitions. Bug: 318730708 Test: m + compare image sizes Change-Id: Id0a06965e61763f59c53cbe2b327cdcf1e5d422b
2024-02-06Merge "Mechanism to select a specific version of java_sdk_library_import" ↵ Spandan Das
into main
2024-02-06Mechanism to select a specific version of java_sdk_library_import Spandan Das
This CL is the java_sdk_library_import equivalent of aosp/2928483. With trunk stable, we will have multiple apex prebuilts in the tree. Each apex prebuilt will have its own module sdk. This means that it is possible to have mutliple versions of `framework-foo` in the tree. This CL introduces a mechanism to select a specific versioned java_sdk_library prebuilt. Implementation details - Add a `source_module_name` property to java_sdk_library_import. This will identify the source equivalent of the jsl in packages/modules. This used to be implicit - i.e. the name without the prebuilt_ prefix. With multiple prebuilts, this has to become explicit. - Set appropriate `source_module_name`(s) in the dynamically created child modules. e.g. the source_module_name on sdklib.v1.stubs and sdklib.v2.stubs will both be sdklib.stubs, assuming `source_module_name` on the top-level jsl_import is sdklib - Add a private Created_by_java_sdk_library_name property to java_import and prebuilt_stubs_sources modules. This will be used to idenfity the top level java_sdk_library_import that was used to create these child modules. This is necessary because java_sdk_library_imoprt is a macro that creates 1:many modules. However, to avoid toil, only the top-level java_sdk_library_import will be listed in `apex_contributions`. This new property will be used for source/prebuilt selection in android/prebuuilt.go - Rename BaseModuleName in commonSdkLibraryAndImportModule to RootLibraryName. This is necesssary because the former is now reserved to identify the source equivalent of a prebuilt module (maybe we should rename it?) Bug: 322175508 Test: Added a unit test Change-Id: If6aa6b0e939a07f8263874941413908383c81a78
2024-02-05Automatically propagate jarjar rules for aconfig libraries Joe Onorato
Test: treehugger Bug: 310504781 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:97c03a6dc659102ff40793759fb3f0f18164a85b) Merged-In: I639d12ff33175b7bed7e7d0595a40dd9b0d99367 Change-Id: I639d12ff33175b7bed7e7d0595a40dd9b0d99367
2024-01-30Merge "Propagate profile_guided requirement of imports to top-level apex" ↵ Spandan Das
into main
2024-01-30Merge "Support mechanism to select a specific version of module sdk ↵ Spandan Das
prebuilt" into main
2024-01-30Merge "Disable stub validation when `WITHOUT_CHECK_API=true`" into main Treehugger Robot
2024-01-30Propagate profile_guided requirement of imports to top-level apex Spandan Das
For prebuilts, the dexpreopt rules of system server jars are now generated from the context of the top-level prebuilt apex and not in the context of the shim java_import modules. Since `dex_preopt.profile_guided` property is defined in java_import, this needs to be bubbled up to the top-level apex. This will be done using deapxerInfo. If profile_guided of a transitive java_import is true, the deapexed .prof file will be set as dexreopter.inputProfilePathOnHost before invoking dexpreopter.dexpreopt. This ensures that only that java_import undergoes profile guided dexpreopt, and not every other transitive java_import Test: go test ./apex -run TestPrebuiltStandaloneSystemserverclasspathFragmentContents Test: lunch cf_x86_64_only_phone-next-userdebug && m $ANDROID_PRODUCT_OUT/system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex Test: du -sh $ANDROID_PRODUCT_OUT/system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex 24K Bug: 308790457 Change-Id: Ibf46ecb400b3f126b243fc8d27b08d9a1aa4cc97
2024-01-30Disable stub validation when `WITHOUT_CHECK_API=true` Jihoon Kang
Even when building stubs from source, the rules for the java_api_library modules are generated although they are not executed. This leads to NPE, as setting `WITHOUT_CHECK_API=true` prevents `checkCurrentApiTimestamp`, which the java_api_library modules depend on, from being generated. To prevent the NPE, this change prevents the `checkCurrentApiTimestamp` from being registered as the dependency of the java_api_library modules when `WITHOUT_CHECK_API=true` is set. Test: BUILD_FROM_SOURCE_STUB=true WITHOUT_CHECK_API=true m nothing Bug: 320601440 Change-Id: I4f19e30d9cd74bdc20dde0d14884fb03ff223ccb