Commit graph

6366 commits

Author SHA1 Message Date
Cole Faust
3f6462693e Downgrade/disable lint checks
Lint is being updated, and some of the
new checks have many failures or false
positives in the current android tree.

Bug: 215567981
Bug: 238784089
Test: Presubmits
Change-Id: I33a47d3c0404ca37f0334421a02bb80f745ae792
2022-07-12 15:19:08 -07:00
Ulya Trofimovich
a04dbddc64 Merge "Remove trash files that were committed by accident." am: 348b777b86
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2149656

Change-Id: Icb6d7e8c0d43055c6691d4f709a92c4526acc55c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 09:58:44 +00:00
Ulya Trofimovich
348b777b86 Merge "Remove trash files that were committed by accident." 2022-07-12 09:32:24 +00:00
Nicolas Geoffray
9d63346c18 Merge "Add a new file for the boot image." am: 4a8dd372f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2149660

Change-Id: I92e5069a76db18e21d555d0c72505be3240b8ba6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 08:20:27 +00:00
Nicolas Geoffray
4a8dd372f0 Merge "Add a new file for the boot image." 2022-07-12 07:59:01 +00:00
Treehugger Robot
41bf7540ab Merge "Revert "Add -Xjvm-defaults=all to kotlin compilations"" am: 7631bdf109
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2149655

Change-Id: I1732a02d2f42a438ba98939f480f0a6ce26e0dd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-11 19:34:41 +00:00
Treehugger Robot
7631bdf109 Merge "Revert "Add -Xjvm-defaults=all to kotlin compilations"" 2022-07-11 19:29:18 +00:00
Nicolas Geoffray
58d349cbe5 Add a new file for the boot image.
In that file, we can list methods which we want to compile but that our
boot image profiling implementation did not cover.

Test: m
Bug: 235557326
Change-Id: I839727c231a09b9208d00f3205996f2add8779bd
2022-07-11 17:47:58 +01:00
Ulya Trafimovich
9af9a4761f Remove trash files that were committed by accident.
The files were added in https://r.android.com/2085466. They do not
affect the build because they are not added to Android.bp.

Bug: none
Test: treehugger
Change-Id: Ibb42212e12249835c569e7d88365344ca599d8f3
2022-07-11 10:50:37 +01:00
Jordan Demeulenaere
b0ef8b16d5 Revert "Add -Xjvm-defaults=all to kotlin compilations"
This reverts commit 7ce6837979.

Reason for revert: b/238405276

Change-Id: Ifcd1c02a3d4505af090cc1cd187730aa959fc463
2022-07-11 09:29:57 +00:00
Cole Faust
d5ac017c49 Merge "Add -Xjvm-defaults=all to kotlin compilations" am: 01365d5890
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2139092

Change-Id: I71d6538976170f0ac5ebf3e520f853a4fefad3f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-08 05:40:19 +00:00
Cole Faust
01365d5890 Merge "Add -Xjvm-defaults=all to kotlin compilations" 2022-07-08 05:18:22 +00:00
Paul Duffin
4057d6455a Merge "Add apexes property to sdk" am: 0d89b3dc27
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096447

Change-Id: Ib57f709febd0827967afcd301825d7dae568b67a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 10:59:52 +00:00
Paul Duffin
0d89b3dc27 Merge "Add apexes property to sdk" 2022-07-07 10:40:00 +00:00
Cole Faust
306061072d Merge "Use the current java version for -jvm-target" am: b0353ed3b1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2139094

Change-Id: I4d06c9105fdef3e24409f1208d019d5e15ad8b53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 06:23:31 +00:00
Cole Faust
b0353ed3b1 Merge "Use the current java version for -jvm-target" 2022-07-07 06:08:18 +00:00
Paul Duffin
4e7d1c43e2 Add apexes property to sdk
Specifying an apex in the apexes propety will cause all the
*classpath_fragments that are contents of the APEX to be automatically
added as members of the sdk and appear in the snapshot.

The purpose of this change is to dedup the APEX and sdk definitions and
try and avoid some of the issues that we have been finding while
attempting to build against the prebuilts.

Two tests, one each for bootclasspath_fragment and
systemserverclasspath_fragment, have been refactored to compare the
output when adding the *fragment to the sdk directly of via the APEX.
That ensures switching to use the APEX will not change the sdk snapshot
unless it was previously missing a *fragment.

There was also a slight difference in where the hidden API flags were
copied from. That should have no impact on the output as the flags are
identical.

The sdk snapshot generation needed some tweaks to avoid generating a
prebuilt for the APEX.

Bug: 232401814
Test: m nothing
Change-Id: I7aaf16a3a0ab4bebf97765d1484215cc008dc4b8
2022-07-06 15:58:43 +00:00
Paul Duffin
e942d5d7e9 Merge "Stop exporting systemserverclasspath_fragment when targeting S" am: 014fded49d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2143673

Change-Id: I2ad06eae7d11f1ef9ae7727a5a41052d48fc9e44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 17:15:57 +00:00
Paul Duffin
014fded49d Merge "Stop exporting systemserverclasspath_fragment when targeting S" 2022-07-05 16:44:10 +00:00
Paul Duffin
f861df7907 Stop exporting systemserverclasspath_fragment when targeting S
Previously, when targeting the S release the generated sdk snapshot
would contain prebuilt_systemserverclasspath_fragment modules even
though they were only added in T.

This allows SdkMemberTypes to specify the set of target build releases
they support and ignores them when targeting an unsupported target
build release.

Test: m nothing
      packages/modules/common/build/mainline_modules_sdks.sh
      # Check that the for-S-build snapshots do not include SSCPFs.
Bug: 237718221
Change-Id: I2df08c2fcebf9b866695d691572a9d3783758b17
2022-07-05 15:13:09 +00:00
Cole Faust
2b4402d43f Merge "Revert^2 "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"" am: 100c7ad7f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2143082

Change-Id: I393938d1bf83b8dc734761679fbd5df10caf1c93
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 23:06:03 +00:00
Cole Faust
100c7ad7f2 Merge "Revert^2 "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"" 2022-07-01 22:48:49 +00:00
Cole Faust
e5bf3fb4c2 Revert^2 "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"
This reverts commit 5d80d895b6.

Reason for revert: The issue that broke the build the first time this was submitted has been fixed in ag/19125702. Also the errorprone build was added to presubmit for changes to these files so we should hopefully catch any other issues at presubmit now: cl/458501206

Change-Id: I80ca08df49c58a1ad70de917822301368d49fc67
2022-07-01 19:39:14 +00:00
Treehugger Robot
f4da9403f3 Merge changes I93edfd61,Icd23b542,I58c84607,Icfa73a75 am: 4d2f767217
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2139101

Change-Id: I35551b07799c29cb56e2ffdaf7c1693b23f4f8d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 13:10:11 +00:00
Treehugger Robot
4d2f767217 Merge changes I93edfd61,Icd23b542,I58c84607,Icfa73a75
* changes:
  Pass -fno-sanitize=vptr,function for musl
  Use musl rust prebuilts for USE_HOST_MUSL=true
  Don't package host cross modules in javaFuzzPackager
  Add rust musl arm and arm64 toolchains
2022-07-01 12:46:58 +00:00
Xin Li
42307c80c7 Merge "Merge tm-dev-plus-aosp-without-vendor@8763363" into stage-aosp-master 2022-06-29 21:16:54 +00:00
Paul Duffin
e7b1f5b0a5 Avoid modifying Compile_dex property
Previously, the code would modify the Compile_dex property to set it to
true if the module was part of an APEX as the APEX needs the dex file.
That lost information about whether the Compile_dex property was
specified in the .bp file and also meant that the APEX variant had
different properties to other variants which could result in unexpected
differences in behavior between them.

One of those differences can occur in the sdk snapshot generation code
which uses the Compile_dex property to determined whether to write a
compile_dex property in the generated snapshot. If it uses an APEX
variant then it will always add compile_dex: true but if it used a non
APEX variant then it would depend on the setting of compile_dex in the
source. That leads to the generated snapshot being affected not just
by the set of modules that are included but also how they were
specified.

This change stops modifying the properties and just uses a local
variable to store the updated value. All the other (4) uses of the
Compile_dex property were checked and 1 accesses the property before
it is updated, 2 access the property from a module type (Import) that
does not update the property and the other is in the sdk snapshot
generation code which accesses it after it has been modified but needs
to access the unmodified value.

This is needed for the follow up change that allows an sdk module to
reference an apex to automatically add exportable parts of the apex
contents to the sdk snapshot avoiding duplication which can lead to
errors.

Bug: 232401814
Test: m nothing
Change-Id: Ibc80d93473a266dc9f9900ec1cb175b51460b5e9
2022-06-29 10:15:52 +00:00
Cole Faust
7ce6837979 Add -Xjvm-defaults=all to kotlin compilations
This causes kotlinc to output default methods
instead of DefaultsImpl inner classes. It's required
for code that depends on other libraries using
@JvmDefault. It will be the default in a future
version of kotlin.

Bug: 236431222
Test: treehugger
Change-Id: I67a7cb3b816b41a441af7ec78cc64bc358c6889d
2022-06-28 16:27:52 -07:00
Cole Faust
d96eebf3bc Use the current java version for -jvm-target
This is a partial revert of aosp/541879.
In that cl, the kotlin jvm version was always
set to 1.8 because that's what the kotlin
complier supported at the time, but now
it supports more versions:

$ ./external/kotlinc/bin/kotlinc -jvm-target foo
error: unknown JVM target version: foo
Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17

Bug: 69160377
Bug: 236431222
Test: Treehugger
Change-Id: I273e0b4d1f484013889e17c60bc1b299a3f975a1
2022-06-28 16:06:16 -07:00
Colin Cross
39a1814f24 Don't package host cross modules in javaFuzzPackager
Normally the host cross OS is windows, which only builds a few opted-in
modules.  When the host cross OS is set to linux_musl it builds all
modules that haven't explicitly opted out, producing linux_musl_common
variants of java modules.  Filter these out of javaFuzzPackager to
avoid conflicts with the linux_glibc_common modules.

Host cross common variants targets were missing the HostCross flag,
so also set it in getCommonTargets.

Bug: 236052820
Test: builds with linux_musl arm64 host cross enabled
Change-Id: I58c846076091bee7df50016c240a176c039c42e9
2022-06-28 15:16:15 -07:00
William Loh
5a082f9a33 Propagate max_sdk_version to manifest_fixer
If max_sdk_version is included in Android.bp that value will now be
propagated to manifest_fixer.py. This value will then be used to
override any maxSdkVersion attribute set on permission or
uses-permission tags in the android manifest if maxSdkVersion="-1".

Bug: 223902327
Test: add max_sdk_version to Android.bp for test app
Test: create permission in test app manifest with maxSdkVersion="-1"
Test: run test to check maxSdkVersion=max_sdk_version
Change-Id: Ic533ef2a41b9ecc9ee68c69399026df47ee945b7
2022-06-28 22:07:23 +00:00
Xin Li
313fdb5812 Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
Change-Id: If059be00e6bdaaa94171b456afae1d585540639c
2022-06-28 21:23:06 +00:00
Ivan Lozano
3742d6ad9e Merge "rust: Allow rust_ffi_shared in jni_libs" 2022-06-28 12:57:05 +00:00
Ivan Lozano
7f67c2a665 rust: Allow rust_ffi_shared in jni_libs
Allow listing rust_ffi_shared modules as a jni_libs dependency
in conjunction with platform_api: true. This allows inclusion by
android_app modules.

Bug: 237304791
Test: android_app module builds with a rust_ffi_shared dependency.
Change-Id: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1
2022-06-27 16:00:26 -04:00
Ian Zerny
750986db96 Merge "Use R8 wrapper target and flags." 2022-06-27 08:30:11 +00:00
TreeHugger Robot
49030cd143 Merge "Move embedded notice file path above aapt rule generation" into tm-dev am: 8378feda12
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/19049995

Change-Id: I3a23f9b49c98c0c6662c768ac8b07b1d4dbeeff4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 20:07:24 +00:00
Colin Cross
61fb62e5e3 Move embedded notice file path above aapt rule generation
The embedded notice file generation for apps was moved below the aapt
rules, which meant the added asset path was ignored.  Move the code
to pick the notice file path selection back above the aapt rules,
and leave the code to generate the notice file rule where it is.

Bug: 236006463
Test: m NetworkStack ALWAYS_EMBED_NOTICES=true
Change-Id: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
Merged-in: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
2022-06-23 18:05:47 +00:00
Colin Cross
3d6cfd14d3 Move embedded notice file path above aapt rule generation
The embedded notice file generation for apps was moved below the aapt
rules, which meant the added asset path was ignored.  Move the code
to pick the notice file path selection back above the aapt rules,
and leave the code to generate the notice file rule where it is.

Bug: 236006463
Test: m NetworkStack ALWAYS_EMBED_NOTICES=true
Change-Id: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
Merged-in: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
2022-06-23 18:05:09 +00:00
Ian Zerny
dc2893aeea Use R8 wrapper target and flags.
Bug: b/227746536
Test: atest --host r8retrace-check-retraced-stacktrace
Change-Id: Ia0f65180181df19f5c043cc371893cfe45d248a9
2022-06-23 12:23:18 +02:00
Treehugger Robot
988a7b3dd4 Merge "Fix normalize string for Java 17" am: 82392b747c am: edb9757a41
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2132595

Change-Id: I309244cb6de9d0deb36aaeee04f79aa7808e743f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 19:08:04 +00:00
Sorin Basca
5938fed33c Fix normalize string for Java 17
Bug: 233029164
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_17=true \
			EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN=true m
Change-Id: Ic436f813ae19cbdb089c63421ffde70a9cdbd83d
2022-06-22 12:53:51 +01:00
Pedro Loureiro
492128b526 Translate SDK codenames to SDK versions for finalized releases am: 489912283e
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18965894

Change-Id: I67c2cd6d39d13ff9bf00b7da5986664da4ae95c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 22:00:47 +00:00
Pedro Loureiro
489912283e Translate SDK codenames to SDK versions for finalized releases
This applies to updatability attributes of shared libraries.

Bug: 235318264

Test: atest UpdatableSharedLibsTest
Change-Id: Id2c2b769a99ca1debb5d8525e46d37698ef2fc6c
2022-06-17 20:01:21 +00:00
TreeHugger Robot
d23c863fae Merge "Fix strip_prefix flags to strip install paths." into tm-dev 2022-06-10 23:06:33 +00:00
Treehugger Robot
302846a63b Merge "Fix strip_prefix flags to strip install paths." am: 20b623da89 am: 28b9607224
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2120624

Change-Id: I5c9edaeb2df8a61eb18fe9368dd2f8e9d1321343
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 20:32:30 +00:00
Treehugger Robot
20b623da89 Merge "Fix strip_prefix flags to strip install paths." 2022-06-10 18:07:41 +00:00
Bob Badour
3d16d5ddf8 Fix strip_prefix flags to strip install paths.
Bug: 235331488

Test: m droid dist

Change-Id: I3cd2af5d90e46a4c983728bc9b2d941d6ffda229
Merged-in: I3cd2af5d90e46a4c983728bc9b2d941d6ffda229
2022-06-09 15:00:08 -07:00
Bob Badour
c6ec9fb849 Fix strip_prefix flags to strip install paths.
Bug: 235331488

Test: m droid dist

Change-Id: I3cd2af5d90e46a4c983728bc9b2d941d6ffda229
2022-06-09 14:24:41 -07:00
Sam Delmerico
b706b4efef add multilib data_device_bins properties
Some targets need to be able to specify the specific architecture for a
data_device_bin module. This commit adds new properties to allow
specification of first, both, 32, or 64 multilib properties.

Bug: 231448797
Bug: 232408185
Test: go test ./java -run TestDataDeviceBinsBuildsDeviceBinary
Change-Id: I457cf4b1a9ccb28b46042f874c96bd0a87009fab
Merged-In: I457cf4b1a9ccb28b46042f874c96bd0a87009fab
2022-06-08 19:26:01 +00:00
Sam Delmerico
b0837c2fe2 Merge "add multilib data_device_bins properties" am: a22e2c982d am: 88fa2f6a6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2113524

Change-Id: Id91e9272c91768dd95cd549d9860667f8fe30a0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 14:53:22 +00:00
Sam Delmerico
a22e2c982d Merge "add multilib data_device_bins properties" 2022-06-08 14:07:11 +00:00
Sam Delmerico
cc271e2065 add multilib data_device_bins properties
Some targets need to be able to specify the specific architecture for a
data_device_bin module. This commit adds new properties to allow
specification of first, both, 32, or 64 multilib properties.

Bug: 231448797
Bug: 232408185
Test: go test ./java -run TestDataDeviceBinsBuildsDeviceBinary
Change-Id: I457cf4b1a9ccb28b46042f874c96bd0a87009fab
2022-06-06 20:11:46 +00:00
Treehugger Robot
2ab17c0491 Merge "bootclasspath_fragment: Require at least one hidden_api package property" am: 4a737a2d8b am: 811d444ce1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2062450

Change-Id: I0e4673a5d702427d752e3e413bae96454b601207
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 18:33:18 +00:00
Treehugger Robot
4a737a2d8b Merge "bootclasspath_fragment: Require at least one hidden_api package property" 2022-06-06 16:05:12 +00:00
Jared Duke
2ecf00081a Merge "Revert "Revert "Use D8 by default for android_test""" am: 44338663a5 am: d810453e7c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2115753

Change-Id: Ibb75070b8e99a4b1b522af5586536ee2652c6e16
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 23:30:03 +00:00
Jared Duke
44338663a5 Merge "Revert "Revert "Use D8 by default for android_test""" 2022-06-02 22:35:43 +00:00
Jared Duke
63a3da94d1 Revert "Revert "Use D8 by default for android_test""
This reverts commit 4e445be558.

Reason for revert: GtsExoPlayerTestCases now uses multidex.

Test: m + manual builds for test_suites_x86_64_coverage
Change-Id: I608b3b79137b216f546446e1c4f89f4542572581
Bug: 192032291
2022-06-02 19:12:30 +00:00
Treehugger Robot
4815e771f9 Merge "Make sure dist files have license metadata." am: f57b54cda7 am: c688531cba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2063295

Change-Id: I09562d127844d389cb6af0c13833c6a463c826ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 18:19:54 +00:00
Bob Badour
5180438478 Make sure dist files have license metadata.
Bug: 151177513
Bug: 210912771

Test: m droid dist reportmissinglicenses

Change-Id: I0c85f6c49a3e9d9bb3219ed6ddfb939d90f80656
2022-06-01 21:07:25 -07:00
Rico Wind
60722b54d0 Merge "Disable deferred tracing in R8" am: d9a0bf79ec am: 567c248ea2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2106305

Change-Id: I929b78d0c25f85c7453838496eae31d0936dd284
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 04:33:13 +00:00
Rico Wind
d9a0bf79ec Merge "Disable deferred tracing in R8" 2022-06-01 03:54:59 +00:00
Treehugger Robot
e6113e96ea Merge "add missing java/*_test.go files" am: 545d509d94 am: dc17cf675d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2108328

Change-Id: I6d97e49fbdbf4c0a1715eeff9db6eb4b22e503fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 20:51:31 +00:00
Treehugger Robot
545d509d94 Merge "add missing java/*_test.go files" 2022-05-31 19:59:09 +00:00
Sam Delmerico
974c6229e2 add missing java/*_test.go files
fuzz_test.go is not included for now because there is a fix in progress
to make tests pass again.

Test: go test ./java
Change-Id: Idd44fb95c1dda728659ebfc58381252ab49c8230
2022-05-31 18:07:03 +00:00
Rico Wind
1cd1729011 Disable deferred tracing in R8
Bug: 227455445
Bug: 233630328
Test: m -j77 SystemUI + disasm grep mStatusBarWindowCallback
Change-Id: I2d6bb859e74c1afc398e629e53d2ce541ef27642
2022-05-30 12:54:25 +00:00
Paul Duffin
4c6b51a1d5 Merge changes I093fbec4,Iee5c09d5 am: 1db9d96d6a am: 7d40722b8f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2062449

Change-Id: Iee15dd53c385454ef8dd1e3f59c813dbf8a68d0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-30 10:14:03 +00:00
Paul Duffin
1db9d96d6a Merge changes I093fbec4,Iee5c09d5
* changes:
  bootclasspath_fragment: Treat some specific modules as test
  bootclasspath_fragment: Add test specific module type
2022-05-30 09:26:24 +00:00
Paul Duffin
ac23cbba12 Merge "Check that API is up-to-date when building java_sdk_library" am: 54e0bb61f0 am: 15e5b40b39
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2107342

Change-Id: I96f41264bc8a79d010b76740500a2698d13eedf0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 16:36:43 +00:00
Paul Duffin
54e0bb61f0 Merge "Check that API is up-to-date when building java_sdk_library" 2022-05-27 16:01:57 +00:00
Paul Duffin
9fd564711e bootclasspath_fragment: Require at least one hidden_api package property
Previously, the split_packages, single_packages and package_prefixes
properties were all optional and the split_packages defaulted to ["*"].
As that value conflicted with the other package properties that meant
that split_packages always had to be specified even if it was to just
set it to an empty array.

This change requires at least one of them to be specified and defaults
split_packages to an empty list which means it is not required,
although it can be helpful to make that explicit.

Bug: 194063708
Test: m nothing
Change-Id: I5a4c2d68e72e39f5c4a2441326dfce8685fc8ff2
2022-05-27 16:27:50 +01:00
Paul Duffin
ff9b6faba2 bootclasspath_fragment: Treat some specific modules as test
Treats bootclasspath_fragment modules that have not yet been converted
to test modules as if they were test modules. This is a temporary work
around to ease the migration to bootclasspath_fragment_test modules and
is expected to be reverted.

Bug: 194063708
Test: m nothing
Change-Id: I093fbec4e926719b644c64ebfc63f9e3070e28db
2022-05-27 16:17:44 +01:00
Paul Duffin
c15b9e99e5 bootclasspath_fragment: Add test specific module type
This is needed to allow the behavior of the bootclasspath_fragment to
be tweaked for test fragments.

Bug: 194063708
Test: m nothing
Change-Id: Iee5c09d5b580d088ba081d95a788dbde883078ed
2022-05-27 16:17:44 +01:00
Paul Duffin
c166b68589 Check that API is up-to-date when building java_sdk_library
Previously, the checked in version of an API was only checked to make
sure it was up-to-date when running the checkapi target. This change
adds a validation dependency to the ninja rule that generates the API
from source so that up-to-date check is always performed every time
the API is generated. However, because it is a validation dependency
it does not lengthen the build's critical path.

Bug: 234113632
Test: echo > packages/modules/SdkExtensions/java/android/os/ext/api/current.txt
      m framework-sdkextension
      # Passes without this change even though the checked in API is
      # not up-to-date.
      # With this change the build fails reporting correctly that the
      # checked in API is not up-to-date.
Change-Id: I8e65cf716d94aecd61bd943f1485468664ad4a22
2022-05-27 14:03:44 +00:00
Treehugger Robot
ce10c28eb9 Merge "sdkLibraryProperties: fix typo" am: bf04adae7c am: 4ca266f966
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2106444

Change-Id: I85e03e534a8e08c59833f410b855002eaa0a3523
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 17:30:06 +00:00
Treehugger Robot
bf04adae7c Merge "sdkLibraryProperties: fix typo" 2022-05-25 16:29:47 +00:00
Mårten Kongstad
81d909525d sdkLibraryProperties: fix typo
Test: m nothing
Change-Id: Id9a0ba0a1123a298b8713f6dd6526ccb54fe5c46
2022-05-25 16:27:55 +02:00
Muhammad Haseeb Ahmad
35ca6bc67f Merge "Make IsSanitizerEnabledForJni return false" am: 53a129db89 am: e353655540
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2105764

Change-Id: Icb9a49ce6817fe2f7fa6a6d35b6b2345cd07035c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 06:59:42 +00:00
Muhammad Haseeb Ahmad
e6567fe56b Make IsSanitizerEnabledForJni return false
Change-Id: I5e1722bc32b63649fc9973d11e9fd5bdea72ddbe
Test: m
2022-05-25 00:13:08 +00:00
Sorin Basca
ec9d37f146 Merge "Add experimental option to target Java 17" am: 78ce8c23de am: a571b7d389
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2104326

Change-Id: Iac56194ce46c845e0498e0fb794f4eb29895d78e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 16:10:38 +00:00
Sorin Basca
ce720c3663 Add experimental option to target Java 17
Bug: 233029164
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_17=true \
      EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN=true m
Change-Id: I80a9ba9eb356a460c1036e711e793c2ca6620f53
2022-05-24 13:05:17 +01:00
Treehugger Robot
a2a665b40e Merge "Clean up some bp2build technical debt" am: 5bec8d41ea am: d5c19f1eb9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2075729

Change-Id: Ia782f52cc1dfb7a43cef80f8fd374160b0208526
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 18:53:44 +00:00
Treehugger Robot
5bec8d41ea Merge "Clean up some bp2build technical debt" 2022-05-23 18:01:04 +00:00
Treehugger Robot
d4899ce231 Merge "Revert "Use D8 by default for android_test"" am: 14b500daba am: 1e2e5fcb73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2100965

Change-Id: I263ec410fc4a118374989d16e0fadee30d9ddf63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 06:20:25 +00:00
Treehugger Robot
14b500daba Merge "Revert "Use D8 by default for android_test"" 2022-05-23 05:49:40 +00:00
Jared Duke
4e445be558 Revert "Use D8 by default for android_test"
This reverts commit 02edc10047.

Reason for revert: Breaks test_suites_x86_64_coverage

Bug: 233421462
Change-Id: I7b04d3fd7802be0f271ea3c29ef25e3d08ab1389
2022-05-23 04:00:44 +00:00
Bob Badour
efdf8ab4cc Fix bug: allow multiple gen_notice modules. am: a5ea2479d3 am: d9771dedbb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2098696

Change-Id: I921b541c513779e4a73a70876a9ffff23e4361f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-21 03:22:39 +00:00
Bob Badour
a5ea2479d3 Fix bug: allow multiple gen_notice modules.
Test: m cts dist reportmissinglicenses

Change-Id: I07963c83eaddfe363a04871e813b56fe7f1465ad
2022-05-20 16:54:00 -07:00
Treehugger Robot
7158bc6012 Merge "Use D8 by default for android_test" am: 1811ed3764 am: db7ee090e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2097291

Change-Id: I898a3308b5fe5d7477a261fc4d20871f5cacb01d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 23:23:50 +00:00
Treehugger Robot
1811ed3764 Merge "Use D8 by default for android_test" 2022-05-20 22:46:15 +00:00
Jared Duke
02edc10047 Use D8 by default for android_test
android_test defaults to using R8, but with shrinking, optimization and
obfuscation disabled, eliminating most of the benefits of R8. Instead,
use D8 by default, improving build performance and avoiding any other
issues that may arise in test-specific code related to whole-program R8
execution. An initial audit shows that android_test targets that *do*
enable shrinking or optimization also explicitly opt in to R8.

A follow-up CL will do the same for android_test_helper_app, but that
requires some additional auditing of downstream targets.

Bug: 192032291
Test: m + presubmit
Change-Id: I5b14a0986dde210f241a77c3a93daacf9e53d667
2022-05-20 12:02:13 -07:00
Paul Duffin
0ccfe77dd3 Merge "Add custom java_sdk_library info to the SDK info file" am: e73d52cb9b am: e917d3ae4c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096802

Change-Id: I27a97a5b6477fe25ce3aafbe8bbdb9ebe2e0bd52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 16:15:25 +00:00
Paul Duffin
e73d52cb9b Merge "Add custom java_sdk_library info to the SDK info file" 2022-05-20 13:59:19 +00:00
Colin Cross
7065be231c Merge "Don't call dexpreopter methods on host modules" am: 6c04c66b7e am: e00639d4ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908174

Change-Id: I6f0685edfd6f809f9839a4063ca2c5608b9f008e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 21:13:50 +00:00
Colin Cross
6c04c66b7e Merge "Don't call dexpreopter methods on host modules" 2022-05-19 20:46:23 +00:00
Bob Badour
00d6beecc9 Merge "Add gen_notice module." am: 335a4333fe am: 15aba3f5e0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2095028

Change-Id: I56c39b0693a8a18b6e43f0536c724e5b26338504
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 19:09:45 +00:00
Bob Badour
335a4333fe Merge "Add gen_notice module." 2022-05-19 18:03:09 +00:00
Bob Badour
eef4c1c563 Add gen_notice module.
Refactor notices to support notices for multiple modules.

Enforce visibility and handle missing dependencies.

Bug: 213388645

Change-Id: Id6a81987f087419ad37d0cce57a71e8a7c4cd6e0
2022-05-18 16:38:19 -07:00
Colin Cross
d7d2a2a6bf Merge "Fix prebuilts of overridden apps" into tm-dev 2022-05-18 17:40:23 +00:00
Lukács T. Berki
5258c42167 Merge "Make java_fuzz_host not implement Sanitizeable." am: 53c6c67cbb am: 2928c292e6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096734

Change-Id: I1827cc21a64596be2af5760519d755c078658383
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 07:33:06 +00:00
Lukács T. Berki
53c6c67cbb Merge "Make java_fuzz_host not implement Sanitizeable." 2022-05-18 06:43:42 +00:00
Colin Cross
5088544ddc Fix prebuilts of overridden apps
AndroidApp had its own HideFromMake method and flag that shadowed
the one in ModuleBase.  This caused performOverrideMutator to set the
AndroidApp flag, but ModuleBase.skipInstall to read the ModuleBase
flag, resulting in a conflicting install rule being created.  Remove
AndroidApp's HideFromMake in favor of the ModuleBase one.

Bug: 232788722
Test: TestOverrideAndroidAppWithPrebuilt
Change-Id: I8c0dfcb50ff4dc1e4d0574f150b10d79908f46aa
Merged-In: I8c0dfcb50ff4dc1e4d0574f150b10d79908f46aa
(cherry picked from commit aaa0c1ffcd)
2022-05-17 14:39:36 -07:00
Treehugger Robot
9f2eab6462 Merge "Fix prebuilts of overridden apps" am: 822029166d am: 7a8e610703
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2099730

Change-Id: Ib50d77543a68c07a7c1f2391225132cf0c91b57a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-17 21:19:07 +00:00
Colin Cross
61df14acce Don't call dexpreopter methods on host modules
Only call the dexpreopter methods on device modules so broken
dexpreopt configs don't break host-only unbundled builds.

Bug: 207813628
Test: tradefed branch builds
Change-Id: I41deb765a29c5cef9130a4d26aad7f956f75cdd5
2022-05-17 13:15:39 -07:00
Treehugger Robot
822029166d Merge "Fix prebuilts of overridden apps" 2022-05-17 19:03:42 +00:00
Lukacs T. Berki
8c77ae369a Make java_fuzz_host not implement Sanitizeable.
Also remove a tiny bit of state mutation from sanitizerMutator. Every
little bit helps!

Test: Prebuilts + comparing soong/build.ninja .
 Your branch is up to date with 'aosp/master'.

Change-Id: I73b28b660b572610242765d87b70ab081b0b43df
2022-05-17 11:25:28 +02:00
Treehugger Robot
7583481570 Merge "Make "overrides" attribute of Android_app overridable" 2022-05-17 06:38:19 +00:00
Colin Cross
aaa0c1ffcd Fix prebuilts of overridden apps
AndroidApp had its own HideFromMake method and flag that shadowed
the one in ModuleBase.  This caused performOverrideMutator to set the
AndroidApp flag, but ModuleBase.skipInstall to read the ModuleBase
flag, resulting in a conflicting install rule being created.  Remove
AndroidApp's HideFromMake in favor of the ModuleBase one.

Bug: 232788722
Test: TestOverrideAndroidAppWithPrebuilt
Change-Id: I8c0dfcb50ff4dc1e4d0574f150b10d79908f46aa
2022-05-16 18:27:00 -07:00
zhidou
198f589222 Make "overrides" attribute of Android_app overridable
Move overrides attribute from appProperties to overridableAppProperties

Bug: 220029162
Test: m
Change-Id: I6f527df3173f142311734333ad37018c83d5e279
Merged-In: I6f527df3173f142311734333ad37018c83d5e279
(cherry picked from commit a2ce78f80d)
2022-05-16 18:26:52 -07:00
Paul Duffin
958806b8c8 Add custom java_sdk_library info to the SDK info file
Previously the SDK info file only contained basic common information
about each member. This change adds support for each member to
provide custom information to add to the info file.

It uses that mechanism to add the following:
* "dist_stem"
* "scopes" object containing:
  * for each scope a:
    "<scope>" object containing:
    * "current_api" - the path within the snapshot for the API's .txt
                      file.
    * "removed_api" - the path within the snapshot for the removed
                      API's .txt file.
    * "latest_api" - the path within the build to the latest finalized
                     API .txt file.
    * "latest_removed_api" - the path within the build to the latest
                             finalized removed API .txt file.

In order to access the latest API files it was necessary to add and
resolve dependencies on the module that makes them available. In order
to do that safely the code for creating the names of the modules was
refactored to avoid duplicating the name creation logic.

Bug: 204763318
Test: m nothing
Change-Id: Ica68abbd2b2c7c2b2b7877b502f96cc89f06fd68
2022-05-16 17:09:10 +00:00
Liz Kammer
3bf97bd1c0 Clean up some bp2build technical debt
Previously we ran mutators in bp2build mode to add dependencies, now we
look up modules by name directly. Remove workarounds to allow bp2build
mode to not fail when adding/handling dependencies.

Test: m bp2build
Change-Id: Ibf6fd905150cac306e5c395902ef28f609f4df2a
2022-05-13 19:47:48 -04:00
Spandan Das
91250b1ae4 Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
Merged-In: Ie8881b857afcec44addf27fc360c5b8abf726bd2
(cherry picked from commit 42e89508ee)
2022-05-13 19:16:23 +00:00
Spandan Das
456a77e9a0 Update sdk_version check for jni_libs of updatable apps
With aosp/1640364, all variants of a cc_* module use min_sdk_version as
the version part of the clang triple. Therefore, checking
min_sdk_version of jni_libs should be sufficient to ensure that there is
no unintended access to symbols in newer Android versions

Test: go test ./java
Test: TH
Bug: 155209650
Bug: 209409604

Change-Id: I6c064f8a6ea12c8aa40165a9063380306a180c9b
Merged-In: I6c064f8a6ea12c8aa40165a9063380306a180c9b
(cherry picked from commit 2e8c044b2c)
2022-05-13 19:15:58 +00:00
Sam Delmerico
c4eb800be1 Merge "disable usage of plugins as static libs" am: 1cb1c45e8c am: ec2519b0b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2076860

Change-Id: Ic840d8ddbfe8bc7c372ec911a560533809974a94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 18:30:07 +00:00
Sam Delmerico
1cb1c45e8c Merge "disable usage of plugins as static libs" 2022-05-13 17:57:15 +00:00
Thiébaud Weksteen
61aacdad9b Merge "java/lint: enable lint on non-generated srcjar" am: 5471f4ea83 am: 161080466b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2086850

Change-Id: I861533e0e24e854f2ad9cc0103bf333b5111c25a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 07:22:46 +00:00
Thiébaud Weksteen
5471f4ea83 Merge "java/lint: enable lint on non-generated srcjar" 2022-05-12 06:26:41 +00:00
Treehugger Robot
904e8d18f0 Merge "Ensure that *bootclasspath* module types depend on device variants" am: 1a6305f9e0 am: 9bc494bc08
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2095251

Change-Id: Ia0a25286a2d5d3b4861f3a91d529fe52655fc68e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:49:39 +00:00
Treehugger Robot
da3b642bf5 Merge "convert java_resources with bp2build" am: 2737c25e9e am: ff063f97fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2042845

Change-Id: I674693e21d9098ad9f185f394ee055dfac6869af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:49:27 +00:00
Sorin Basca
9bf8eb89da Merge "Strip annotations from library stubs" am: 61c6eef064 am: 12dd25adda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092623

Change-Id: I05e2c8f527e3f38139d0bb6b9d8c75e27a61570c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:49:08 +00:00
Anton Hansson
ddbf242004 Merge "Use lint database from api_versions_public" am: b82b392423 am: 17094ecba8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092228

Change-Id: Ie5447a6494befbc1ace3f1938181658b2cd79d4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:48:08 +00:00
Spandan Das
f454194692 Merge changes Ie8881b85,I6c064f8a am: f923333a93 am: e41be189f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2090231

Change-Id: I1eebfc246a05fdb728d1c9460f322f657f7d36df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:47:28 +00:00
Anton Hansson
3bc0cdc239 Merge "Support using api-versions.xml from another module" am: 4d92d831ca am: 63c05717b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092227

Change-Id: I5265bd5e426cbe14371044a83c46c6a4517de82d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:46:56 +00:00
Anton Hansson
3f2e8ce166 Merge "Use merged annotations zip for lint" am: 3881e8d7fb am: 58729fada2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092226

Change-Id: I553a73673be5fb34c4c6756809611d61c93856ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:46:46 +00:00
Anton Hansson
15d071f64b Merge "Write AndroidMk for api-versions.xml module" am: 55c157791e am: adfab19c93
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092225

Change-Id: Id3fab7a78bd098d0c7fa4e915e26634a9eb2ffa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:46:33 +00:00
Treehugger Robot
1a6305f9e0 Merge "Ensure that *bootclasspath* module types depend on device variants" 2022-05-11 20:43:30 +00:00
Treehugger Robot
2737c25e9e Merge "convert java_resources with bp2build" 2022-05-11 19:58:48 +00:00
Paul Duffin
b2c2173bfd Ensure that *bootclasspath* module types depend on device variants
Needed to allow change https://r.android.com/2089503 to be reapplied.

Bug: 232106778
Test: Apply the change and then run
      m EMMA_INSTRUMENT=true nothing
Change-Id: I92d19c51cc828295ba13951e65911db707f0f2ba
2022-05-11 15:20:37 +00:00
Sorin Basca
61c6eef064 Merge "Strip annotations from library stubs" 2022-05-11 13:46:25 +00:00
Anton Hansson
b82b392423 Merge "Use lint database from api_versions_public" 2022-05-11 08:11:45 +00:00
Sorin Basca
69f4b082b9 Strip annotations from library stubs
Bug: 222743634
Test: m
Change-Id: Ic44bd7c4c163b723295eb369664432d3651b8597
2022-05-10 19:41:59 +01:00
Spandan Das
f923333a93 Merge changes Ie8881b85,I6c064f8a
* changes:
  Enforce updatable=true on apps of updatable apexes
  Update sdk_version check for jni_libs of updatable apps
2022-05-10 18:20:27 +00:00
Sam Delmerico
79985819fe convert java_resources with bp2build
Test: b build --platforms=//build/bazel/platforms:linux_x86
  //external/jarjar:jarjar-binary and try to use on a jar
Change-Id: Id6f4e6937687fd575360fbacaeda55c41922636e
2022-05-10 14:32:52 +00:00
Spandan Das
42e89508ee Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
2022-05-10 00:01:34 +00:00
Anton Hansson
67cf60e7c5 Use lint database from api_versions_public
These two databases are (nearly) identical but the latter is generated
in a much more efficient way.

The diffs are very minor and it's not clear to me which versions is more
correct than the other, though I'm fairly confident they don't matter.

https://paste.googleplex.com/5567994005553152

Bug: 187398174
Test: diff api-versions.xml
Change-Id: I0fa35d4067bc06936b4a31bda0bca7fd41f26aae
2022-05-09 13:10:24 +00:00
Anton Hansson
c04a16ef0b Support using api-versions.xml from another module
Metalava has two different flags surrounding api-levels:
- one for generating api-versions.xml to a file
- one for applying api-versions.xml from a file

Previously, soong always applied both of these arguments at the same
time, such that framework-doc-stubs both generated and applied
api-versions.xml.

Add support for using api-versions.xml from another module name as well.

Bug: 187398174
Test: droidstubs_test.go
Change-Id: I8288fe4788336d5d5c60d09d48b00ca111449fba
2022-05-09 12:18:17 +00:00
Anton Hansson
ea17a45c26 Use merged annotations zip for lint
The framework-doc-stubs annotations.zip is no longer the correct
zip to use after b/187397779. It doesn't contain the module annotations.

Test: presubmit
Change-Id: I50e0bcc026c97886a31256e2387632c19d4b287f
2022-05-09 10:26:58 +00:00
Anton Hansson
4bf0080b25 Write AndroidMk for api-versions.xml module
Soong does not write AndroidMk output if the default outputfile is
invalid. The default output file for droidstubs modules is the srcjar,
but not all droidstubs modules have srcjars. Make it also write
AndroidMk entries for droidstubs that only have an api-versions.xml
output.

A similar exception already existed for the api txt files, so use the
same mechanism.

Bug: 187398174
Test: m nothing && grep Android-${TARGET_PRODUCT}.mk
Change-Id: I5cbcf42d877ca166d172b727c0aa2bdf6d9af744
2022-05-09 10:26:58 +00:00
Thiébaud Weksteen
5c26f8185a java/lint: enable lint on non-generated srcjar
Soong made the assumption that any .srcjar was generated source, for
which the lints were not executed. It may not be the case for .srcjar
that are manually created. Run the linter on any .srcjar that has been
provided within the src attribute, but ignore any source generated
.srcjar (such as .proto or .aidl).

Test: m lint-check
Bug: 228774926
Change-Id: If214fb57f54049fce54297ee6bf65d734b3d2e6d
2022-05-09 11:19:14 +10:00
Spandan Das
2e8c044b2c Update sdk_version check for jni_libs of updatable apps
With aosp/1640364, all variants of a cc_* module use min_sdk_version as
the version part of the clang triple. Therefore, checking
min_sdk_version of jni_libs should be sufficient to ensure that there is
no unintended access to symbols in newer Android versions

Test: go test ./java
Test: TH
Bug: 155209650
Bug: 209409604

Change-Id: I6c064f8a6ea12c8aa40165a9063380306a180c9b
2022-05-08 01:26:58 +00:00
Yurii Zubrytskyi
932a5faa66 Merge "build/soong - support the REL platform version in classpath" into tm-dev am: 2c268407dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18138216

Change-Id: Ia4f13f6b834634a358383cc529507638268dd964
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-07 15:39:08 +00:00
Yurii Zubrytskyi
a14c447bcb Revert "Hacky workaround for half-finalized builds." am: 3cdd35199d
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18135676

Change-Id: I9ad0bf5b1126ffef4472ebfb2d064bae0cde834a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-07 15:38:55 +00:00
Yurii Zubrytskyi
2c268407dc Merge "build/soong - support the REL platform version in classpath" into tm-dev 2022-05-07 15:11:19 +00:00
Treehugger Robot
171991c36a Merge "Treat kotlin-annotations the same as kotlin-stdlib" am: a11603a538 am: f0e3ea0b88
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2086464

Change-Id: I98171585a4369716fdd620c4ed9f133300b9cb8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 17:55:15 +00:00
Treehugger Robot
a11603a538 Merge "Treat kotlin-annotations the same as kotlin-stdlib" 2022-05-06 17:00:08 +00:00
Yurii Zubrytskyi
3cdd35199d Revert "Hacky workaround for half-finalized builds."
This reverts commit 50493f0797.

Reason for revert: build is now fully finalized

Change-Id: Iaa5b9d84b84303a8b8baf30641d861a035169f48
2022-05-06 16:10:04 +00:00
Yurii Zubrytskyi
1611334fa2 build/soong - support the REL platform version in classpath
Make sure we select the proper API level number for the REL
platform version when generating the classpath protos

Bug: 231272086
Test: build + boot emulator
Change-Id: Ib3b711dc05dd6136a68e6de414d806687a849bc9
2022-05-06 16:09:52 +00:00
Colin Cross
063544747e Treat kotlin-annotations the same as kotlin-stdlib
Upgrading dagger uncovers an issue where java-only modules with
kotlin-containing dependencies may see org.jetbrains.annotations.NotNull
annotations.  Include the kotlin-annotations in the output jar the
same way kotlin-stdlib is included.

Bug: 227669740
Test: TestKotlin
Change-Id: Ifc33a32b121c1b9a9d1911bdec332264b78b571c
2022-05-04 19:07:32 +00:00
Treehugger Robot
eb89a79400 Merge "Revert "Don't add uses_libs/optional_uses_libs to the manifest_fixer."" am: be4c7eda08 am: b20002cdeb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2085466

Change-Id: Ibc412099ec92bee26dc33c63f978e0ba14da9b2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 16:38:28 +00:00
Treehugger Robot
be4c7eda08 Merge "Revert "Don't add uses_libs/optional_uses_libs to the manifest_fixer."" 2022-05-04 15:19:37 +00:00
Ulya Trafimovich
f5d91bb3b4 Revert "Don't add uses_libs/optional_uses_libs to the manifest_fixer."
This reverts commit 0b1c70efbc.

The reverted commit was based on the idea that uses-libraries that are
explicitly specified in build files should not be implicitly added to
the manifest, as that would mean that anything added to the build files
will flow to the manifest.

Although this logic is correct, it prevents propagation of
uses-libraries from dependencies, which is wrong: if a library has an
explicit uses-library property in Android.bp, this property is expected
to be propagated to the library's dependencies. Failing to do so would
mean that every user of that library has to add uses-library property to
their build files, which doesn't scale (see b/214255490 for example).

Bug: 214255490
Test: lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd \
    && adb wait-for-device && adb root \
    && adb logcat | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
    # empty output, no errors at boot
Change-Id: I6f420e76a89aa2f37be99f877711736640f2c361
2022-05-04 12:10:06 +01:00
Colin Cross
dddb402c02 Add missing dependency on compose plugin in kapt rules
The kapt rule uses kotlincFlags but was not using kotlincDeps,
causing the rule to get the -Xplugin argument on the compose
compiler plugin jar, but not have a dependency on it.

Bug: 231222079
Test: TestKotlinCompose
Change-Id: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
(cherry picked from commit 08b0a1cd79)
Merged-In: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
2022-05-03 17:07:27 +00:00
Paul Duffin
4c35ba0de1 Merge "Prevent non-app/non-test modules from statically including jacocoagent" into tm-dev am: fe45ae8feb
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18133382

Change-Id: I5dc7aa3dca9acbf673dbbd049bfe5ff720655b0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 13:21:57 +00:00
Paul Duffin
0038a8d374 Prevent non-app/non-test modules from statically including jacocoagent
(cherry picked from commit 3953153c9e)

Previously, the .impl library of java_sdk_library modules would end up
with the jacocoagent statically included. That is because their
Instrument flag was set to true when created by their parent. As that
was before the deps were added that meant that they ended up with a
static dependency on jacoagent (at least when UnbundledBuild() was
true).

That was not previously a problem because the .impl files were only
used at build time. However, a recent change to make updatable-media
statically include framework-media.impl (which statically included the
jacocoagent classes) broke the coverage build because the jacocoagent
classes are not in the permitted packages for the updatable-media.

When instrumenting the bootclasspath the jacocoagent library is added
to the art-bootclasspath-fragment.

The jacocoagent should only be statically included in apps, or test
apps. This change adds an extra flag to specify whether the module type
supports statically including the jacocoagent. This is set to true by
apps and test apps but not when the java_sdk_library creates the .impl
java_library preventing it from statically including jacocoagent.

Bug: 230967146
Bug: 229932396
Test: COVERAGE_MODULES=media \
      PRODUCT=mainline_modules_x86 \
      TARGET_BUILD_APPS=com.google.android.media \
      vendor/google/build/build_unbundled_coverage_mainline_module.sh
      # Fails without this change, passes with it.
Merged-In: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
Change-Id: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
2022-05-03 10:11:59 +00:00
Treehugger Robot
c45647c798 Merge "Add missing dependency on compose plugin in kapt rules" am: 6c59cdb5c7 am: 7a0e9509bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2084483

Change-Id: Ia854a3da32397f2dbfff756de500db781443595e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 05:52:00 +00:00
Treehugger Robot
6c59cdb5c7 Merge "Add missing dependency on compose plugin in kapt rules" 2022-05-03 02:28:14 +00:00
Paul Duffin
3953153c9e Prevent non-app/non-test modules from statically including jacocoagent
Previously, the .impl library of java_sdk_library modules would end up
with the jacocoagent statically included. That is because their
Instrument flag was set to true when created by their parent. As that
was before the deps were added that meant that they ended up with a
static dependency on jacoagent (at least when UnbundledBuild() was
true).

That was not previously a problem because the .impl files were only
used at build time. However, a recent change to make updatable-media
statically include framework-media.impl (which statically included the
jacocoagent classes) broke the coverage build because the jacocoagent
classes are not in the permitted packages for the updatable-media.

When instrumenting the bootclasspath the jacocoagent library is added
to the art-bootclasspath-fragment.

The jacocoagent should only be statically included in apps, or test
apps. This change adds an extra flag to specify whether the module type
supports statically including the jacocoagent. This is set to true by
apps and test apps but not when the java_sdk_library creates the .impl
java_library preventing it from statically including jacocoagent.

Bug: 230967146
Bug: 229932396
Test: COVERAGE_MODULES=media \
      PRODUCT=mainline_modules_x86 \
      TARGET_BUILD_APPS=com.google.android.media \
      vendor/google/build/build_unbundled_coverage_mainline_module.sh
      # Fails without this change, passes with it.
Change-Id: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
2022-05-03 00:46:55 +00:00
Colin Cross
08b0a1cd79 Add missing dependency on compose plugin in kapt rules
The kapt rule uses kotlincFlags but was not using kotlincDeps,
causing the rule to get the -Xplugin argument on the compose
compiler plugin jar, but not have a dependency on it.

Bug: 231222079
Test: TestKotlinCompose
Change-Id: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
2022-05-02 14:00:50 -07:00
Sam Delmerico
0d1c4a0fee disable usage of plugins as static libs
Test: m auto_value_plugin
Test: m androidx.appsearch_appsearch-compiler
Test: m intdef-annotation-processor-test
Test: atest intdef-annotation-processor-test
Test: m view-inspector-annotation-processor-test
Test: atest view-inspector-annotation-processor-test
Test: m Robolectric_processor_tests
Test: atest Robolectric_processor_tests
Bug: 225388628
Change-Id: I9e3dd81f44333b680f2e81283c02a9be5a4de15b
2022-05-02 20:53:45 +00:00
Treehugger Robot
ab954a80e5 Merge "java_sdk_library_import: Delegate OutputFiles to impl library if needed" am: 9c60cc4f22 am: 4bc5fbb974
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2081279

Change-Id: I5838bc533fa4c7ff44a25283a14cdcc27d6241d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:26:15 +00:00
Paul Duffin
64d5a525f4 Merge "hiddenapi: Prevent libraries for Q/R from include S+ flags." am: a09d95f605 am: c06a700dcc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2079360

Change-Id: I47fca3348146cddbc042acb5fbfeea9dbfb7bb4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:24:49 +00:00
Victor Chang
197ec71ec9 Merge "Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"" am: 99666e2720 am: 611f75ea9a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2081278

Change-Id: Ib989959b0b864c46f519d57295c5647321db009c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:16:50 +00:00
Vinh Tran
c1a8f931a3 Merge "bp2build converts java_version property to javacopts attribute" am: 775b44fa50 am: f4b263c487
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2072296

Change-Id: I65ceaa0414ca153fdb737af38dc7ec94c9a9e00e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:14:30 +00:00
Paul Duffin
3c93829245 Merge "Allow framework-media to build the framework-media.impl" am: fb14b52747 am: 79c44417b0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2079359

Change-Id: I80bead78c74f6f3335ee68d4138f99868542e46c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:09:02 +00:00
Treehugger Robot
62803617c5 Merge "Replace DEX_FLAGS by flags for D8 and R8." am: d5a57a5679 am: 1b50e80f92
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2059767

Change-Id: I6843e40400b06f971ce2f5d152d667774f5f603d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:05:04 +00:00
Ulya Trofimovich
340fa7cca8 Merge "Remove obsolete dexpreopt config option UseArtImage." am: a465e28bcb am: c58470bc37
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2069027

Change-Id: I715de13e60f746c9e5be2433116a727783af9007
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:04:44 +00:00
Spandan Das
2a42e55457 Disable newapi check in defaults
- Making newapi disabled by default will ensure that this lint check
  does not run on the platform. This prevents noisy lint warnings like b/228956345#1
- This lint check will continue to be enforced on the transitive deps of
  apexes, since lint.strict_updatability_linting will be true for those
  Soong modules

Test: TH
Test: m
out/soong/.intermediates/frameworks/base/services/core/services.core.unboosted/android_common/lint/lint-report.xml
// file no longer contains "Call requires API level ..." warning
Bug: 228956345

Merged-In: I8ef3137394011fb679a1129f80f6351fb05a4eff
Change-Id: I8ef3137394011fb679a1129f80f6351fb05a4eff
(cherry picked from commit 397e910835)
2022-04-29 17:36:07 +00:00
Spandan Das
a3264efb42 Enforce newapi check only if min_sdk_version < compile_sdk_version
- NewApi check should be enforced only if min_sdk_version is less than
  the compile_sdk_version (the opposite direction should be a different
  build-time error)
- Change the datatype of *sdkVersion to android.ApiLevel (from string)
  to support version comparisons

Test: go build ./java
Test: no changes in ninja file
Bug: 228956345

Merged-In: Ic408857db7760d912ef4694d2ed72c0b7106eb04
Change-Id: Ic408857db7760d912ef4694d2ed72c0b7106eb04
(cherry picked from commit ba7e532a11)
2022-04-29 17:35:51 +00:00
Treehugger Robot
9c60cc4f22 Merge "java_sdk_library_import: Delegate OutputFiles to impl library if needed" 2022-04-29 17:27:23 +00:00
Paul Duffin
2b5384bc93 Merge "java_sdk_library_import: Delegate OutputFiles to impl library if needed" into tm-dev 2022-04-29 16:26:07 +00:00
Paul Duffin
a80cc174a2 hiddenapi: Prevent libraries for Q/R from include S+ flags.
The Q and R runtimes can handle Q/R flags but not S flags. So, this
change verifies that any library that can run on Q/R
(min_sdk_version <= R) by adding --max-hiddenapi-level=max-target-r
to the "hiddenapi encode" command. That will cause a failure if any
S+ flags are found in the flags to encode.

Bug: 172453495
Test: m droid && launch_cvd
      Cherry pick changes in https://r.android.com/q/topic:max-target-s
      Add @UnsupportedAppUsage maxTargetSdk=S in classes in framework-permission (for r/q)
      and framework-permission-s (nominally for S+). I had to incresed the min_sdk_version
      in the latter to 31 (S) as it was still set at 30 (R).
Merged-In: Ie0f68482603adc7b4e3d7a5c81bf203d81a84a9e
Change-Id: Ie0f68482603adc7b4e3d7a5c81bf203d81a84a9e
(cherry picked from commit 09817d66de)
2022-04-29 14:08:30 +00:00
Paul Duffin
3cf140fe98 java_sdk_library_import: Delegate OutputFiles to impl library if needed
Bug: 230846030
Test: m nothing
      # Cherry pick into build with prebuilts enabled to verify.
Merged-In: I5ac9b1cdd2fc61efbc988e84556202ff6cd57146
Change-Id: I5ac9b1cdd2fc61efbc988e84556202ff6cd57146
(cherry picked from commit 1e940d5b44)
2022-04-29 14:05:22 +00:00
Paul Duffin
1e940d5b44 java_sdk_library_import: Delegate OutputFiles to impl library if needed
Bug: 230846030
Test: m nothing
      # Cherry pick into build with prebuilts enabled to verify.
Change-Id: I5ac9b1cdd2fc61efbc988e84556202ff6cd57146
2022-04-29 14:42:04 +01:00
Paul Duffin
a09d95f605 Merge "hiddenapi: Prevent libraries for Q/R from include S+ flags." 2022-04-29 13:37:35 +00:00
Victor Chang
99666e2720 Merge "Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"" 2022-04-29 10:34:41 +00:00
Nataniel Borges
5d80d895b6 Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"
This reverts commit 8b7f627f30.

Reason for revert: b/230821289

Change-Id: I3032103b174c78586b38b64d2748ec5a42fa9522
2022-04-29 09:49:16 +00:00
Vinh Tran
3ac6daf47c bp2build converts java_version property to javacopts attribute
This CL also converts `external/rappor` (which already set `java_version` to `1.7`) to be bazelable to testify the changes.

Results from `b build //external/rappor && cat bazel-bin/external/rappor/librappor.jar-0.params`: https://paste.googleplex.com/5518725462622208.

Test: go test ./bp2build/...
Bug: 227618664
Change-Id: I8d370d4639f70fba51e6de6ceb7bcb5ace9ccd91
2022-04-28 18:52:48 -04:00
Paul Duffin
a083ec4acf Allow framework-media to build the framework-media.impl
(cherry picked from commit 77590a8263)

The framework-media java_sdk_library is currently api_only for legacy
reasons. This change allows it to also build the framework-media.impl
library by making the following changes:
* Adds impl_only_static_libs to allow the implementation to statically
  include other libraries, something no other java_sdk_library has
  needed to do.
* Passes the apex_availability property through to the impl library so
  it can be statically included in the updatable-media which is what is
  included in the apex, again for legacy reasons.

Bug: 190807367
Bug: 229932396
Test: m com.android.media media-module-sdk
      # Compare before and after this change (and corresponding change
      # to updatable-media/framework-media.
Merged-In: I9e1837edcca6f5fa84fc611274cf8fbba8a896b8
Change-Id: I9e1837edcca6f5fa84fc611274cf8fbba8a896b8
2022-04-28 21:49:52 +00:00
Paul Duffin
fb14b52747 Merge "Allow framework-media to build the framework-media.impl" 2022-04-28 21:10:16 +00:00
Paul Duffin
09817d66de hiddenapi: Prevent libraries for Q/R from include S+ flags.
The Q and R runtimes can handle Q/R flags but not S flags. So, this
change verifies that any library that can run on Q/R
(min_sdk_version <= R) by adding --max-hiddenapi-level=max-target-r
to the "hiddenapi encode" command. That will cause a failure if any
S+ flags are found in the flags to encode.

Bug: 172453495
Test: m droid && launch_cvd
      Cherry pick changes in https://r.android.com/q/topic:max-target-s
      Add @UnsupportedAppUsage maxTargetSdk=S in classes in framework-permission (for r/q)
      and framework-permission-s (nominally for S+). I had to incresed the min_sdk_version
      in the latter to 31 (S) as it was still set at 30 (R).
Change-Id: Ie0f68482603adc7b4e3d7a5c81bf203d81a84a9e
2022-04-28 18:34:48 +01:00
Paul Duffin
77590a8263 Allow framework-media to build the framework-media.impl
The framework-media java_sdk_library is currently api_only for legacy
reasons. This change allows it to also build the framework-media.impl
library by making the following changes:
* Adds impl_only_static_libs to allow the implementation to statically
  include other libraries, something no other java_sdk_library has
  needed to do.
* Passes the apex_availability property through to the impl library so
  it can be statically included in the updatable-media which is what is
  included in the apex, again for legacy reasons.

Bug: 190807367
Bug: 229932396
Test: m com.android.media media-module-sdk
      # Compare before and after this change (and corresponding change
      # to updatable-media/framework-media.
Change-Id: I9e1837edcca6f5fa84fc611274cf8fbba8a896b8
2022-04-28 14:30:14 +00:00
Treehugger Robot
d5a57a5679 Merge "Replace DEX_FLAGS by flags for D8 and R8." 2022-04-28 12:40:13 +00:00
Ulya Trofimovich
a465e28bcb Merge "Remove obsolete dexpreopt config option UseArtImage." 2022-04-28 09:44:21 +00:00
Treehugger Robot
35e5179349 Merge "Fix erroneous "Field requires API level 33 (current min is 32)" warnings" am: fcf0b686aa am: 587f8c3425
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2072628

Change-Id: I7cc60174e9e525181cbf51dfd20e2e3e89f5c241
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 23:30:58 +00:00
Cole Faust
8b7f627f30 Fix erroneous "Field requires API level 33 (current min is 32)" warnings
Bug: 215567981
Bug: 204776549
Test: m out/soong/.intermediates/frameworks/base/framework-minus-apex/android_common/lint/lint-report.xml, then check that that file doesn't have any of these warnings
Change-Id: I39aa2228474630c93250bf5833ac6bd9bbadcc7f
2022-04-27 12:20:08 -07:00
Muhammad Haseeb Ahmad
809cd79d01 Merge "Add jni support to java_fuzz_host" am: 4e70b7586a am: 5b63f52025
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2045705

Change-Id: I3b9da743e9cf88e8defdb6610630e37a8bfa46b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 17:56:23 +00:00
Treehugger Robot
f7814a1ccb Merge "Deduplicate classLoaderContexts field between two structs." am: b3f437ae7b am: 5c02379a49
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2077658

Change-Id: I5f74c22213d7b84b5d1c2fefff18e26d1285384f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 17:53:01 +00:00
Muhammad Haseeb Ahmad
4e70b7586a Merge "Add jni support to java_fuzz_host" 2022-04-27 16:14:29 +00:00
Treehugger Robot
b3f437ae7b Merge "Deduplicate classLoaderContexts field between two structs." 2022-04-27 14:53:14 +00:00
Ulya Trafimovich
442ec7fc07 Remove obsolete dexpreopt config option UseArtImage.
Bug: 170935728
Test: lunch aosp_cf_x86_64_phone-userdebug && m && lunch_cvd
Change-Id: Id83b9085794fd2ec338077ca909f84e04ccad041
2022-04-27 13:36:47 +01:00
Ulya Trafimovich
12164ded20 Deduplicate classLoaderContexts field between two structs.
This field is provided by the `dexpreopter` struct, which is a part of
`java.Module` and also had an identially named field. This created
confusion when the latter field was not properly copied into the former,
which resulted in not propagating class loader context, e.g. for static
library "androidx.preference_preference". This didn't cause class loader
context mismatch errors at boot previously, because the library didn't
have any uses-library dependencies before a recent prebuilt update.

Bug: 214255490
Test: lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd \
    && adb wait-for-device && adb root \
    && adb logcat | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
    # empty output, no errors at boot
Change-Id: Ib818c5d2934d28817bb7a04b6114ae8b82a5c04d
2022-04-27 11:59:34 +01:00
Treehugger Robot
0963f95b61 Merge changes I8ef31373,Ic408857d am: 7cb3f50fda am: 143af5947d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2072577

Change-Id: I5370568a1abe5f1aad58c1f8cc4c15a44742a377
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 01:43:24 +00:00
Treehugger Robot
7cb3f50fda Merge changes I8ef31373,Ic408857d
* changes:
  Disable newapi check in defaults
  Enforce newapi check only if min_sdk_version < compile_sdk_version
2022-04-27 00:55:56 +00:00
Muhammad Haseeb Ahmad
7e74405b2d Add jni support to java_fuzz_host
Bug: 219782880
Test: m example_java_fuzzer_with_native_lib, go test -run TestJavaFuzz
Change-Id: I1d05fb449e5378a27a0096869d9c12ca0a1245c6
2022-04-26 18:49:02 +00:00
Spandan Das
397e910835 Disable newapi check in defaults
- Making newapi disabled by default will ensure that this lint check
  does not run on the platform. This prevents noisy lint warnings like b/228956345#1
- This lint check will continue to be enforced on the transitive deps of
  apexes, since lint.strict_updatability_linting will be true for those
  Soong modules

Test: TH
Test: m
out/soong/.intermediates/frameworks/base/services/core/services.core.unboosted/android_common/lint/lint-report.xml
// file no longer contains "Call requires API level ..." warning
Bug: 228956345

Change-Id: I8ef3137394011fb679a1129f80f6351fb05a4eff
2022-04-25 18:17:11 +00:00
Spandan Das
ba7e532a11 Enforce newapi check only if min_sdk_version < compile_sdk_version
- NewApi check should be enforced only if min_sdk_version is less than
  the compile_sdk_version (the opposite direction should be a different
  build-time error)
- Change the datatype of *sdkVersion to android.ApiLevel (from string)
  to support version comparisons

Test: go build ./java
Test: no changes in ninja file
Bug: 228956345

Change-Id: Ic408857db7760d912ef4694d2ed72c0b7106eb04
2022-04-25 18:12:50 +00:00
Ian Zerny
727ab9033a Replace DEX_FLAGS by flags for D8 and R8.
This adds the heap space flag currently set in wrappers.

Bug: b/227746536
Test: manual
Change-Id: Ic3cb8feb7a09d690ecd309162236e49a8d1e52c6
2022-04-25 11:17:07 +02:00
Treehugger Robot
e0a1f2edf8 Merge "Fix error message formatting" am: 224879e794 am: 16991b22ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2073767

Change-Id: I65e7cf023c69ab37e512bb7d25e4979ee41639cb
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-23 12:57:36 +00:00
Treehugger Robot
224879e794 Merge "Fix error message formatting" 2022-04-23 12:24:08 +00:00
Pedro Loureiro
ea2f5eff5e Fix error message formatting
Test: m nothing

Fixes: 230086179
Change-Id: Ieb6a7de9dcf0c12184c868b5af9af52c7b4bfa5e
2022-04-22 13:53:16 +00:00
Treehugger Robot
d5696881ec Merge "Limit JIT tier for D8" am: 00be8b8bda am: 62737cf4f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2070112

Change-Id: Id84b9462597e68db95a26913d36e0b78212a877a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-22 07:49:49 +00:00