Commit Graph

8365 Commits

Author SHA1 Message Date
Priyanka Advani
58b978f11d Merge "Revert "Set strict_mode to true"" into main 2024-05-30 18:39:01 +00:00
Kevin Liu
6a20769a50 Revert "Set strict_mode to true"
Revert submission 27234948-default_strict_mode

Reason for revert: b/343559188
Reverted changes: /q/submissionid:27234948-default_strict_mode

Change-Id: Ib06e3d269e606477d5e8f8acc9a26ebf332447a8
2024-05-30 18:20:25 +00:00
Treehugger Robot
b700e55760 Merge "Use r8/d8 optimized profile for dexpreopt" into main am: 8723705fad am: b18a30edde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3095860

Change-Id: I67a2cc8d84fd930a20f6113a302f604eb53fa3f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-29 22:55:41 +00:00
Treehugger Robot
b5d52bea91 Merge "Update build to handle documentation issues being errors" into main am: 1705676dd0 am: b61caca9d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3106478

Change-Id: I50bc06d9dea2a113ed0defd8b3871dae03d097a4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-29 22:11:43 +00:00
Treehugger Robot
b18a30edde Merge "Use r8/d8 optimized profile for dexpreopt" into main am: 8723705fad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3095860

Change-Id: Ifc3c21a58ff94bf7ece2a23b1f66c35eb7e51872
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-29 02:33:11 +00:00
Spandan Das
3dbda18e80 Use r8/d8 optimized profile for dexpreopt
Currently, dexpreopt supports profile guided optimization. This does not
work well with r8/d8 optimization, since the checked-in profile will not
match the dex signatures after r8/d8 has optimized the dex code.

This CL introduces a new property `dex_preopt.enable_profile_rewrting`.
If set, the checked-in profile will passed as `input` to r8 via
`--art-profile <input> <output>`. The <output> from the previous command
will be used as the profile for dexpreopt.

Test: m nothing --no-skip-soong-tests
Test: m CredentialManager with https://ag.corp.google.com/27448930
and obfuscation turned on
Test: nm -U symbol.odex # contains obfuscated methods

Bug: 335418838

Change-Id: I53beed9ed76f013262f1c503de0f2b74997c2a7f
2024-05-29 01:05:05 +00:00
Treehugger Robot
b61caca9d4 Merge "Update build to handle documentation issues being errors" into main am: 1705676dd0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3106478

Change-Id: I8e5af23977fedacef49dab1b65923098cab99e09
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-28 23:20:31 +00:00
Kevin Liu
b8787e674b Merge "Set strict_mode to true" into main 2024-05-28 20:09:03 +00:00
Paul Duffin
baf34783a4 Update build to handle documentation issues being errors
Previously, documentation issues had `lint` severity (which was between
`warning` and `hide`) by default. However, a recent change in Metalava
switched documentation issues to `error`. That broke some `droidstubs`
modules that either did not specify `api_lint` or were previously allow
listed to not use `--lints-as-errors`.

This change adds `--error-when-new-category Documentation` to the
Metalava arguments on any use of `droidstubs` that did not previously
specify `--lints-as-errors` to prevent the build breakage while still
warning developers of the problem and preventing new cases being added.

Bug: 343157584
Test: ./gradlew
Change-Id: Id80bc05e2dade580b2f3ac6416aeeed6b64ba22a
2024-05-28 17:37:20 +01:00
Xin Li
8a31520ef8 Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550
Merged-In: I4a6dd1c5e48db7085ea41035def31f0844948a46
Change-Id: If8ad1d0d87495bbd685f5f9f03f5eb7ea78bf192
2024-05-24 08:25:18 -07:00
Jihoon Kang
959fd4c642 Merge "Propagate DirectlyInAnyApex to transitive dependencies" into main am: d02bd377da am: d6638ef5e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3098497

Change-Id: I2fa7154d8e24ce8db740b83dbd35fa73d02e70a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-24 01:17:03 +00:00
Jihoon Kang
d02bd377da Merge "Propagate DirectlyInAnyApex to transitive dependencies" into main 2024-05-24 00:58:05 +00:00
Jihoon Kang
46d66de1c1 Propagate DirectlyInAnyApex to transitive dependencies
`UpdateDirectlyInAnyApex` is used to propagate the ApexProperties
`DirectlyInAnyApex` and `InAnyApex` to the direct dependencies of the
direct dependencies of an apex bundle. In other words, this will be
propagated only to two-levels max dependency from the apex bundle.

However, the implementation library of the sdk library can have longer
dependency chain from the apex bundle than two levels:
e.g. apex -> bcpf -> sdk_lib -> sdk_lib impl lib

Therefore, even if the implementation library of the sdk library is
registered as a dependency using the "CopyDirectlyInAnyApexTag"
dependency tag, the ApexProperties would not be propagated to the
implementation library. In order to resolve this issue and recognize
the implementation library to be directly in apex and allow
instrumentation for the implementation library, this change proposes
propagating `DirectlyInAnyApex` and `InAnyApex` to transitive
dependencies on top of direct dependencies.

Test: DIST_DIR=dist_dir TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86_64 COVERAGE_MODULES="uwb" ./vendor/google/build/build_unbundled_coverage_mainline_module.sh && \
unzip -l out/target/product/module_x86_64/jacoco-report-classes-all.jar and ensure that framework-uwb is included
Bug: 341170242

Change-Id: I27d7a74f6e5bc3e0a044d13c619f4897b6b2eb57
2024-05-23 22:40:35 +00:00
Treehugger Robot
cc2b4f482e Merge "Allow experimental Java target 21 by default" into main am: bc44eb03db am: 1e6f57b6dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3099283

Change-Id: Icbd72acac5b729b16b71c3fac4d55ca29232163a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-23 17:51:23 +00:00
Treehugger Robot
bc44eb03db Merge "Allow experimental Java target 21 by default" into main 2024-05-23 16:37:21 +00:00
Sorin Basca
253f8c045a Allow experimental Java target 21 by default
Bug: 342332820
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_21=true m
Change-Id: I6cc21bf191385df91c2446b7cd6291a0e3532bea
2024-05-23 10:28:24 +01:00
Treehugger Robot
20602731de Merge "Instrument impl library belonging to apexes" into main am: b07e7fd542 am: 18f487824f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3095998

Change-Id: I3e5f678eff3335489b7427265fca864baa91ddbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-22 19:26:15 +00:00
Treehugger Robot
b07e7fd542 Merge "Instrument impl library belonging to apexes" into main 2024-05-22 19:01:41 +00:00
Jihoon Kang
690df2e31b Instrument impl library belonging to apexes
https://r.android.com/3094444 has removed instrumentation from the
implementation library of the java sdk library. However, given that the
top level java sdk library was not being instrumented before removing
the compilation action, there is no way to get the coverage data for the
java sdk library included in the mainline modules with the
aforementioned change.

As seen in b/340174053, instrumenting all impl libraries by default
may lead to double instrumentation execution time error in some edge
cases (especially with make to soong dependency).

Given the above two conditions, this change allows instrumentation for
the implementation library of the java sdk library that belongs to
apex(es).

Test: lunch husky-trunk_staging-userdebug && EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m droid dist
Test: DIST_DIR=dist_dir TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86_64 COVERAGE_MODULES="uwb" ./vendor/google/build/build_unbundled_coverage_mainline_module.sh
Bug: 341170242
Change-Id: I175e02f61e139296f5a177e6fc1c3ded760ac028
2024-05-22 04:27:38 +00:00
Treehugger Robot
6c5e35e5df Merge "implement InstallDepNeeded for sdkLibraryComponentTag" into main am: 1bd60b7c79 am: 479452bfe0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3095012

Change-Id: I306682cf799f81d2bbdd50bce34ba0ed8ce36b80
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-22 01:49:27 +00:00
Treehugger Robot
1bd60b7c79 Merge "implement InstallDepNeeded for sdkLibraryComponentTag" into main 2024-05-22 01:15:52 +00:00
Joe Onorato
5dde31e2ea Merge "Fix the problem of resource integration confusion caused by not adding regional configuration tailoring." into main am: 30f6e28295 am: a06b6fc59a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3092729

Change-Id: If7565504e003e6b53123aa6490b7a7ab42a55b4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-22 00:36:59 +00:00
Joe Onorato
30f6e28295 Merge "Fix the problem of resource integration confusion caused by not adding regional configuration tailoring." into main 2024-05-22 00:02:04 +00:00
Michael Wright
d71211f54a Merge "VanillaIceCream/35 is now REL" into main 2024-05-21 17:59:25 +00:00
Jeongik Cha
aaa6dcdabb implement InstallDepNeeded for sdkLibraryComponentTag
To include a sdk library impl and a permission xml for that.

Bug: 340365498
Test: m aosp_cf_system_x86_64 && check if there is a sdk lib impl and
permission xml

Change-Id: I10190fb9d398b6249efd6fe50b204e328250f23f
2024-05-22 00:43:20 +09:00
Treehugger Robot
eb6cc8f471 Merge changes from topic "revert-3094658-revert-3088867-QEHDREAABY-IOPVAUIKWL" into main am: 652824c8d6 am: 54629c10f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3094481

Change-Id: I1be044576419d098008a3622c4633ad425cf74fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-20 23:15:19 +00:00
Treehugger Robot
f5c0dd854d Merge "Create empty monolithic hiddenapi flags files for non java devices." into main am: 766a156fac am: c068cbece3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3093141

Change-Id: Ic4bf2f6eef1562c4699a88acd185ae8f2015a06c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-20 23:14:19 +00:00
Treehugger Robot
652824c8d6 Merge changes from topic "revert-3094658-revert-3088867-QEHDREAABY-IOPVAUIKWL" into main
* changes:
  Revert^2 "Refactor how jni_libs dependencies are added"
  Revert^2 "Add make java.dependencyTag installable or not"
  Revert "Revert "APK-in-APEX should set use_embedded_native_libs:..."
  Revert^2 "Install jni symlinks in Soong"
2024-05-20 23:00:05 +00:00
Treehugger Robot
cba5958357 Merge "Do not instrument the implementation library of sdk_library" into main am: 58dace8454 am: fddb5b55a2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3094444

Change-Id: Ie9d6b2e144299e43f69c230df3dd9ec9e2cb7af3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-20 22:23:46 +00:00
Treehugger Robot
766a156fac Merge "Create empty monolithic hiddenapi flags files for non java devices." into main 2024-05-20 22:21:29 +00:00
Treehugger Robot
58dace8454 Merge "Do not instrument the implementation library of sdk_library" into main 2024-05-20 21:45:27 +00:00
Jiyong Park
92d8404bc5 Revert^2 "Refactor how jni_libs dependencies are added"
562d9054e5

Change-Id: Ib9e6efc736bd0ba20637afb0a8d05b9b0266586f
2024-05-21 06:41:37 +09:00
Jiyong Park
c1e5b1848a Revert^2 "Add make java.dependencyTag installable or not"
f14b5ba863

Change-Id: I0638d4997cb8e5178f869ea0f469a1a5c141611e
2024-05-21 06:41:36 +09:00
Jiyong Park
970c524ab5 Revert "Revert "APK-in-APEX should set use_embedded_native_libs:..."
Revert submission 3094658-revert-3088867-QEHDREAABY

Reason for revert: not a regression
Reverted changes: /q/submissionid:3094658-revert-3088867-QEHDREAABY

Change-Id: Ie1e4a196f181643a3e64e573b132d52d7455461b
2024-05-21 06:41:36 +09:00
Jiyong Park
25b9222a43 Revert^2 "Install jni symlinks in Soong"
b7646e4d4f

This is a relanding of I0930cb1ebb8ca8a6efd64b1ce2cdfd1c47fe19ef plus
some forward fix described below:

Export non-embedded JNI lib names via LOCAL_REQUIRED_MODULES

The non-embedded JNI libs are installed as the dependencies of the APK.
However, that dependency is not revealed to the Make world and as a
result, the JNI libs are dropped from the file_list.txt file which Make
uses to filter files to include in the image file.

Adding the lib names to LOCAL_REQUIRED_MODULES fixes it.

Bug: 341335305
Bug: 330276359
Test: m out/target/product/vsoc_x86_64_only/obj/PACKAGING/system_intermediates/file_list.txt
and check if libcarservicejni.so is there
Test: go test ./... under soong/java

Change-Id: If915a05909129c92fab7a6cbbd0c4c55f5ced598
2024-05-21 06:40:14 +09:00
优秀
d75e99859b Fix the problem of resource integration confusion caused by not adding regional configuration tailoring.
An android app is automatically creating a corresponding "product
characteristics" RRO. The app's resources are filtered by the aapt
product config, but the rro resources are not. This cl makes the RRO
resources also filtered.

When building the CN version, it was expected that only the resources
corresponding to the CN version would be retained, but the actual result
was that other unexpected areas appeared on the region setting interface
in boot interface. After investigation, it was found that the
framework-res__nosdcard__auto_generated_characteristics_rro.apk apk
integrated resources other than the CN version that caused this problem,
and the integration of this apk was not filtered by aaptconfig.
The purpose of this modification is to add aaptconfig filtering, and it
has been verified that this problem can be fixed.

Change-Id: I85d5d07397bd2b0759d35b9f3a07f015346af4e9
Signed-off-by: wybxyx <wybxyx@gmail.com>
2024-05-20 21:35:12 +00:00
Jihoon Kang
34155e3363 Do not instrument the implementation library of sdk_library
Currently, the implementation library of the java_sdk_library is always
being instrumented due to the issue described in b/159241638.

With https://r.android.com/3079425, all compilation actions of the
java_sdk_library is delegated to the implementation library.
Consequently, this has caused all java_sdk_library to be instrumented,
leading to coverage builds failing due to double instrumentation (i.e.
instrumenting an already instrumented class file). In order to prevent
such error, this change modifies the property of the implementation
library to not instrument during coverage builds.

This change also copies some additional java library properties from
that of the implementation library to the top level sdk library, in
order to ensure that all non-null androidmk entries are correctly
reflected in that of the sdk library.

Test: lunch husky-trunk_staging-userdebug && EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m droid dist
Bug: 340174053
Bug: 341170242
Change-Id: I9d8f1c190205fa7a827649961ba5222293a945ad
2024-05-20 19:08:49 +00:00
Spandan Das
a90db96bb9 Create empty monolithic hiddenapi flags files for non java devices.
This is a followup https://r.android.com/3089366 that disabled the
creation of out/soong/hiddenapi/hiddenapi* files for non java device
builds. This works fine for `m`, but `m dist` runs issues since
`f/b/boot/Android.bp` dists these files. For non java devices, the
previous implementation would report missing files during ninja
excecution (https://b.corp.google.com/issues/338363444#comment5)

This CL creates empty files for these so that the dist tags can always
be resolved.

Bug: 338363444
Test: lunch aosp_cf_x86_64_minidroid-trunk_staging-userdebug && m dist
Change-Id: Ice2d970a164246753da89a6a06dfd28a627a272d
2024-05-20 18:56:28 +00:00
Treehugger Robot
f325babc6d Merge changes Ifbe123d1,Ie2e738a6 into main am: 8298134503 am: 665ece7963
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3083813

Change-Id: I849464d86f7b07e661bc4106e3dc2e77eebdeddd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-20 18:17:39 +00:00
Treehugger Robot
8298134503 Merge changes Ifbe123d1,Ie2e738a6 into main
* changes:
  Support min_sdk_version overrides in apexes
  Support min_sdk_version overrides in apps
2024-05-20 17:38:11 +00:00
Spandan Das
50801e20a3 Support min_sdk_version overrides in apexes
The use case for this are go apexes which are only installed in T and
above, even though the base AOSP apexes might be installable on < T
devices.

If provided, the overridden min_sdk_version will be
1. Used as the `min_sdk_version` in the manifest file of the
   top-level override apex binary
2. Used to build the transitive closure of its dependency with that
   min_sdk_version, i.e. with a different apex variant.

(2) requires some special handling. At ToT, the outgoing transition
value is the base apex name (e.g. com.android.foo). Since
min_sdk_version of the overridding apex can be different than the
overridden apex, the base apex name is no longer sufficient. Instead,
transition to the name of the overriding apex com.mycompany.android.foo.
If deduping is possible, transitive deps will get deduped to
`apex_<min_sdk_version>` later.

Test: added a unit test
Test: in internal, modified min_sdk_version of com.google.android.go.art
locally, built BA and Go apexes, and used `aapt2 dump badging` to verify
that BA has minSdkVersion of 31 and Go has minSdkVersion of 33

Bug: 295311875

Change-Id: Ifbe123d1517fccbc0c058042b8a6eeb3609b6787
2024-05-20 16:24:52 +00:00
Yu Shan
b3522d1a34 Merge changes from topic "revert-3088867-QEHDREAABY" into main am: 4978080b1d am: ac1562ed60
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3094658

Change-Id: Ic2e0c3eec619c880ca8a866b2007f1186e071be7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 23:31:44 +00:00
Yu Shan
4978080b1d Merge changes from topic "revert-3088867-QEHDREAABY" into main
* changes:
  Revert "Install jni symlinks in Soong"
  Revert "APK-in-APEX should set use_embedded_native_libs: true"
  Revert "Add make java.dependencyTag installable or not"
  Revert "Refactor how jni_libs dependencies are added"
2024-05-17 22:55:51 +00:00
Spandan Das
99a60f9ee8 Merge "Disable monolithic hiddenapi flags generation for non java devices." into main am: d700486907 am: c2452d90ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3089366

Change-Id: I57a3fce3ea0e8156bd24d5a1bef0ea9b569ddfe5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 21:58:32 +00:00
Spandan Das
b9c58350ca Support min_sdk_version overrides in apps
This replaces the global override of min_sdk_version (via
`APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE`) with an min_sdk_version override
that can be set by each individual soong override_app.

The use case for this are go apps which are only installed in T and
above, even though the base AOSP apexes might be installable on < T
devices.

Test: added a unit test

Bug: 295311875
Change-Id: Ie2e738a6786bb24417c675617f7c78358017c96c
2024-05-17 21:15:04 +00:00
Spandan Das
d700486907 Merge "Disable monolithic hiddenapi flags generation for non java devices." into main 2024-05-17 21:11:31 +00:00
Yu Shan
b7646e4d4f Revert "Install jni symlinks in Soong"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: Ie4ff26fe47e1a0ab5e97b185c61cb94473cc5fb8
2024-05-17 13:37:37 -07:00
Yu Shan
d5e435d749 Revert "APK-in-APEX should set use_embedded_native_libs: true"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: I3064caef0cb55d1594951835a1173c667f58e607
2024-05-17 13:37:30 -07:00
Yu Shan
f14b5ba863 Revert "Add make java.dependencyTag installable or not"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: I60052dbb004df58fdfaf93be6089769ab2a670fc
2024-05-17 13:37:20 -07:00
Yu Shan
562d9054e5 Revert "Refactor how jni_libs dependencies are added"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: Ibda68b268e74ffca1840faae01a2f3fe2e00be30
2024-05-17 13:37:07 -07:00