Commit Graph

7038 Commits

Author SHA1 Message Date
Mark White
c9b16799b5 java_library support for building headers-only
Flag for java_library modules to build just the Turbine headers and
skip building an impl jar.

Test: m framework-minus-apex-headers
Bug: 289776578
Ignore-AOSP-First: Change stacked with changes in internal repos

Change-Id: If8b4033462d39c689cba0ed38cc343e4786ea280
2023-08-16 23:22:50 +00:00
Jihoon Kang
662e2c5e98 Move from-text stub java_api_library modules closer to source
This change moves java_api_library modules that were previously defined
in build/orchestrator closer to where their from-source equivalents are
defined.

Ignore-AOSP-First: Resolve merge conflict

Test: m (default to from-text stub build)
Bug: 274805756
(cherry picked from https://android-review.googlesource.com/q/commit:fb5331fd3eff558b5f0751692db38cd77018f1b6)
Change-Id: If66b5bba719bb389a69f2353d2218a89b2b96b90
2023-08-16 19:22:28 +00:00
Paul Duffin
f654a0db64 Merge "Revert "Re-enable checks that pass in udc-dev-plus-aosp and downstream"" into udc-dev-plus-aosp am: 33008518e1 am: 1987d4da6c am: 33c3e55d45
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/24441311

Change-Id: I163a6670ce62601f2a88b1a60063b23c3b5b0b7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-16 13:32:50 +00:00
Paul Duffin
33008518e1 Merge "Revert "Re-enable checks that pass in udc-dev-plus-aosp and downstream"" into udc-dev-plus-aosp 2023-08-16 11:11:55 +00:00
Paul Duffin
58c2388f92 Revert "Re-enable checks that pass in udc-dev-plus-aosp and downstream"
This reverts commit bdc0578df1.

Reason for revert: b/296088866

Change-Id: I053314736758f48ea99920a141443c1489d2477b
2023-08-16 08:04:26 +00:00
Treehugger Robot
0cc296c9bc Merge "Stop sdk_library generated api_library to depend on full surface api_library" into main am: f5ee8e3ffc am: b880908c09 am: 740c5a4011 am: 0454473c23 am: d0b1fdbc26
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2674197

Change-Id: Ib790eeecaf2dd39badbdc5c7dc16da5145ecbbcf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-15 23:38:47 +00:00
Mark White
4fac9ea8b2 Merge "SdkTestCore for non-updatable modules" into main 2023-08-15 21:47:25 +00:00
Treehugger Robot
740c5a4011 Merge "Stop sdk_library generated api_library to depend on full surface api_library" into main am: f5ee8e3ffc am: b880908c09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2674197

Change-Id: I2c6de2f158b111dd103c50584cb88d5cd9cb8eac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-15 20:38:35 +00:00
Mark White
beb6e9ffdb SdkTestCore for non-updatable modules
Provides SdkTestCore/test_core_current sdk_version for non-updatable
modules that have their test scope dependent on test apis from
framework-minus-apex.

Ignore-AOSP-First: Change in topic with internal-first projects
Bug: 289776578
Test: m checkapi | go test ./java

Change-Id: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
2023-08-15 12:37:37 +00:00
Jihoon Kang
ba0b8e9a7e Merge "Add previous_api property to java_api_library module" into main am: 9a3cd19bee am: 7bdc85175f am: 706d31cb27 am: 83ca3ce0ec am: e31d2662fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2685826

Change-Id: I0bd40cbfd962c79275f862a2959ce0c74ef4f1cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 22:56:54 +00:00
Jihoon Kang
706d31cb27 Merge "Add previous_api property to java_api_library module" into main am: 9a3cd19bee am: 7bdc85175f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2685826

Change-Id: Ia9d23a2c145a0172ad22dc44a0916854a508e818
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 21:46:17 +00:00
Jihoon Kang
e7ee256746 Stop sdk_library generated api_library to depend on full surface api_library
Since full_api_surface_libs extract class files instead of srcjar file,
full_api_surface_stub can be replace with android_*_stubs_current,
instead of the api_library android_*_stubs_current.from-text.
Functionally, the class files of the two modules are identical (in
from-text stub build), but depending on the from-text java_api_library
leads to missing dependency errors in partial branches (especially ART
branches). To resolve this problem, make sdk_library generated
api_library depend on the missing dependency handled
android_*_stubs_current.

Since android_module_lib_stubs_current.from-text does not have its
from-source equivalent, this can remain as dependency as the module is
moved to build/soong in aosp/2674196

Test: m (default to from-text stub build)
Bug: 274805756
Change-Id: Ic8bbd25252e5f9f1dc7c059ce6b00a951188985d
2023-08-14 21:18:13 +00:00
Jihoon Kang
e52590be2a Convert additional sdk_library stub libraries to from stub generation am: 0c705a448f am: 965d58af92 am: 5803ca5737 am: be62f141cc am: 8382920b4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2689126

Change-Id: I91db0ba1829fc4c9114baca108233db704f6359e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 20:26:04 +00:00
Jihoon Kang
5803ca5737 Convert additional sdk_library stub libraries to from stub generation am: 0c705a448f am: 965d58af92
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2689126

Change-Id: I3ad5fd10ceeea803a0964fda38d311b74464cfa8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 18:19:39 +00:00
Jihoon Kang
862da6f233 Add previous_api property to java_api_library module
`Previous_api` is used to migrate nullness information in metalava (i.e.
convert @Nullable and @NonNull to @RecentlyNullable and @RecentlyNonNull
for some methods). The input is required to generate loosely equivalent
from-text stubs.

Test: m && compare nullness annotations between from-source stubs and from-text stubs
Bug: 293962901
Change-Id: Ic7a0868415fdb2c65d0d472e527fe73280b7651d
2023-08-14 17:18:40 +00:00
Jihoon Kang
0c705a448f Convert additional sdk_library stub libraries to from stub generation
legacy.i18n.module.platform.api, stable.i18n.module.platform.api and
conscrypt.module.platform.api contributes to api surfaces, but the
corresponding stub libraries were being generated from source during
from-text stub build. This discrepancy may lead to hiddenapi failure.
Thus, enable these modules to be built from txt files during from-text
stub build.

Test: m
Bug: 274805756
Change-Id: I940dc8484b210bb8aea57ead1055983be7cdf5ec
2023-08-14 17:17:48 +00:00
Paul Duffin
a0436a88dc Merge "Pass the current API file to the metalava --use-same-format-as option" into main am: 64876012de am: 41ce7e62e1 am: 4ea34ac332 am: 0ca0c697bc am: c2c0065996
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2706154

Change-Id: I7eaceee55fdc7a5fe6bf48af475cdd0a18ae94e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 17:33:06 +00:00
Treehugger Robot
8bbe824e77 Merge changes I33846cdb,I1eb1f4bf into main am: 69ea5b8267 am: a823f9da87 am: 3d0e7d57b4 am: 5a4b14effe am: e9ec119291
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2705698

Change-Id: I8481e93853f5522fc0124e9da7796033a49c1b58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 17:32:47 +00:00
Paul Duffin
4ea34ac332 Merge "Pass the current API file to the metalava --use-same-format-as option" into main am: 64876012de am: 41ce7e62e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2706154

Change-Id: I4f6628e36a899fd5956a07e1dad1de930f1075aa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 14:56:50 +00:00
Treehugger Robot
3d0e7d57b4 Merge changes I33846cdb,I1eb1f4bf into main am: 69ea5b8267 am: a823f9da87
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2705698

Change-Id: Ic64a65e649c2482702c89046f3e155c64d1dfecd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 14:56:34 +00:00
Paul Duffin
64876012de Merge "Pass the current API file to the metalava --use-same-format-as option" into main 2023-08-12 13:27:37 +00:00
Jihoon Kang
478ca5b79e Move scopeOrderedSourceFileNames as outside var
This change enables scopeOrderedSourceFileNames to be not computed
everytime when the function is called, but instead is computed once.

Test: m
Bug: 295429988
Change-Id: I33846cdb7a750e44e45049dbd342aa6ab8b70c4c
2023-08-11 23:36:11 +00:00
Paul Duffin
10a23c29e2 Pass the current API file to the metalava --use-same-format-as option
That will allow the format of a file to be changed by simply modifying
the signature format in the current API file (e.g. from `2.0` to `3.0`)
and then running `m update-api` and it will just update the current API
file (and the corresponding removed API file).

Bug: 295577788
Test: m checkapi && m update-api
      # Also did as described above and modified the
      # `libcore/api/current.txt` file from `2.0` to `3.0` and ran
      # `m update-api` and checked that only that file and the
      # corresponding `removed.text` file was changed.
Change-Id: I20c9bc151677502cf09b0c06fb442fd385caccdd
2023-08-12 00:06:42 +01:00
Jihoon Kang
84473f55d7 Sort api files by api scope in java_api_library
Recent changes in metalava (aosp/2704325) enforces api files passed as
inputs to generate stubs from txt to be sorted in the order from the
narrower api scope to the wider api scope. In order to comply with this
change, all api files passed as inputs to metalava invocations need to
be sorted in the respective order.

Test: m out/soong/.intermediates/packages/modules/IPsec/tests/cts/CtsIkeTestCases/android_common/e10894d3da5db41239526c9048962355/javac/CtsIkeTestCases.jar --build-from-text-stub --skip-soong-tests (Failing module from incorrect class hierarchy when building from text stub)
Bug: 295429988
Change-Id: I1eb1f4bf8fa34fd7dc8a0e4c04aa056258a975c5
2023-08-11 22:58:54 +00:00
Treehugger Robot
4189ebdbd5 Merge "Re-enable checks that pass in udc-dev-plus-aosp and downstream" into udc-dev-plus-aosp am: b2ddb1dba6 am: bbfb393d25 am: c297bae679
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/24376335

Change-Id: I89f272f444615a3928d3fcfa4d0fc19e6175b590
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11 00:05:54 +00:00
Treehugger Robot
e9f33e5975 Merge "Replace -bootclasspath and -classpath metalava options with --classpath" into main am: 19e00b350a am: d55db730fa am: 3f83296cd6 am: 5d2c8373f0 am: 68d483241f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2703433

Change-Id: I50d3c1d91048fdcc0df57c7786176313cbb9407f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10 22:34:32 +00:00
Treehugger Robot
b2ddb1dba6 Merge "Re-enable checks that pass in udc-dev-plus-aosp and downstream" into udc-dev-plus-aosp 2023-08-10 20:48:23 +00:00
Paul Duffin
f8aaaa13f4 Replace -bootclasspath and -classpath metalava options with --classpath
Metalava has not differentiated between bootclasspath and classpath for
years so this change replaces the use of the two deprecated single
hyphen options with `--classpath`.

Bug: 295136054
Test: m checkapi
Change-Id: I3ab20b76a60cab66a27784b7d87a069813d19835
2023-08-10 15:16:35 +01:00
Colin Cross
bdc0578df1 Re-enable checks that pass in udc-dev-plus-aosp and downstream
Re-enable ForegroundServiceType and MutableImplicitPendingIntent,
which have been fixed in udc-dev-plus-aosp and downstream.

Bug: 294098365
Test: treehugger
Ignore-AOSP-First: re-enabling checks that fail in AOSP
Change-Id: Ifa581e8d346cf7e70387d6aa3135203d6a7d621b
2023-08-09 14:52:50 -07:00
Treehugger Robot
7029bed5ed Merge "Stop using single-hyphen metalava options" into main am: 18801036c7 am: 552bba8fe8 am: 5117cdf8dc am: 23679dd6d9 am: 3b81eca727
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2700874

Change-Id: I0075a192e347d26f2235553330f94be3ab07e61b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-09 18:11:16 +00:00
Treehugger Robot
18801036c7 Merge "Stop using single-hyphen metalava options" into main 2023-08-09 14:35:40 +00:00
Paul Duffin
808211e519 Stop using single-hyphen metalava options
`-encoding` and `-source` have been deprecated in metalava.

`-encoding` actually does nothing apart from check to make sure that
the value is `utf-8` (in some case). Metalava always uses `utf-8`.

`-source` has been deprecated in favor of `--java-source` as metalava
also can consume kotlin and it has its own `--kotlin-source` option.

Bug: 295136054
Test: ./gradlew
Change-Id: I08e6931958f40022d65d417360e32b72a1d70444
2023-08-09 12:38:46 +01:00
Colin Cross
9b419ad17f Merge "Don't generate aapt2 srcjars when using resource processor" into main am: 002764c8ee am: 1a436c9b61 am: c2bb066321 am: 005bef73b0 am: e6c9c91cb9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2690449

Change-Id: Ia0223900eac77f27ae8cce63607f523c434d8217
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 22:21:24 +00:00
Liz Kammer
c519bc6f28 Merge "Add unconverted reason for jarjar incompatibility." into main am: 6b6b150d0a am: 7d941462bb am: 1397a3a96b am: 472f943b6d am: 44536d9bfa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2696067

Change-Id: I7d831ad01c92b86d585764dc8cbcffa58a649353
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 20:48:44 +00:00
Colin Cross
002764c8ee Merge "Don't generate aapt2 srcjars when using resource processor" into main 2023-08-08 18:57:02 +00:00
Colin Cross
f6ba044abd Merge "Downgrade newly failing lint checks" into main am: bd6294cc9c am: fb426396d2 am: b2e9f2caf9 am: 30849b097a am: 81b792a9bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2681380

Change-Id: Ie2ac73b49a66b3b4a8096df789ac9e920bf69877
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-04 21:12:02 +00:00
Liz Kammer
7f375869ab Add unconverted reason for jarjar incompatibility.
Test: m bp2build
Change-Id: I112b84fa53f57b9df2bd1e1616012fe55b48001e
2023-08-04 16:39:57 -04:00
Colin Cross
bd6294cc9c Merge "Downgrade newly failing lint checks" into main 2023-08-04 16:50:08 +00:00
Colin Cross
b6d6ac7e4f Merge "Delete aapt2 generated java files after creating srcjars" into main am: 482ccfab04 am: b5c37f9bac am: 10ecc7ed1e am: 815ac4eaad am: ed4697d11b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2690453

Change-Id: I27a1a17b44c585cbf998f04877305fe6bf43d203
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-03 22:44:16 +00:00
Colin Cross
482ccfab04 Merge "Delete aapt2 generated java files after creating srcjars" into main 2023-08-03 18:57:24 +00:00
Colin Cross
f3b7bada56 Don't generate aapt2 srcjars when using resource processor
When using resource processor the R.class files are generated
directly, and the R.java files generated by aapt2 are unused.  These
files can huge, reaching 500 MB for some modules and 76 GB across
all modules for a checkbuild on internal main.  They will be deleted
after zipping into srcjars after Ie5143e1e4b36ca1f4e45b001d79aca5379063517,
but we can skip generating them completely for modules where resource
processor is used.

Bug: 284023594
Bug: 294285775
Test: m checkbuild
Change-Id: If5e3fd1d25c6c7860898776ecdd392be8850c17c
2023-08-02 21:50:38 -07:00
Colin Cross
3b1e71c958 Delete aapt2 generated java files after creating srcjars
The R.java files generated by aapt2 are unused after they are zipped
into srcjars.  These files can huge, reaching 500 MB for some modules
and 76 GB across all modules for a checkbuild on internal main.
Delete the R.java files after after zipping them into srcjars.

Bug: 294285775
Test: m checkbuild
Change-Id: Ie5143e1e4b36ca1f4e45b001d79aca5379063517
2023-08-02 21:50:37 -07:00
Colin Cross
9fa43ad2e3 Downgrade newly failing lint checks
Downgrade new lint checks that are failing to warnings.

Bug: 294098365
Test: treehugger
Change-Id: If236199b22c31d95acbffaefee569c806ef0018d
2023-08-03 00:57:41 +00:00
Roy Luo
2631bcd34e Merge "Revert "Reland "Enable R8 full mode by default for apps""" into main 2023-08-03 00:00:25 +00:00
Roy Luo
74a5c2ec76 Revert "Reland "Enable R8 full mode by default for apps""
This reverts commit a9f5c57b90.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/test_investigate/?invocationId=I59400010184068138&testResultId=TR41428835561759069&tab=trace, bug b/294287299

Bug:294287299
Change-Id: Id7bbe3b1a4cdc999c6a4cb9002b60c882b34f11e
2023-08-02 23:56:46 +00:00
Treehugger Robot
cfe9e6d008 Merge "Reland "Enable R8 full mode by default for apps"" into main 2023-08-02 21:38:29 +00:00
Rico Wind
21862285ac Enable compact entries for resource shrunken apps
For SystemUIGoogle this is a 2.3 MB reduction (17* of resources arsc) and for Traceur it is a 500k reduction (22% of resources.arsc)

Bug: 294016857
Test: Existing
Ignore-AOSP-First: The resource system support for this is not in AOSP yet

Change-Id: I513078406494ad354c255afa0e829cbe10a9b07a
2023-08-02 05:38:19 +00:00
Treehugger Robot
448a4b528b Merge "Ensure extracted JNIs are stored properly in APKs" into main am: a7c5278fbe am: 928eaccad0 am: 1c7fe15d9c am: e593e46ba0 am: f87bff6922
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2681735

Change-Id: I774dbc6f016134b789fb1180ea59391b11912544
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 01:59:33 +00:00
Treehugger Robot
a7c5278fbe Merge "Ensure extracted JNIs are stored properly in APKs" into main 2023-07-31 22:47:05 +00:00
Jared Duke
a9f5c57b90 Reland "Enable R8 full mode by default for apps"
This is attempt 3 at landing this change. Prior attempts were
reverted due to downstream test breakages not in presubmit.
Those issues have been resolved, and additional manual heavy
presubmit tests were run to ensure stability.

Observed APK savings: ~24MB

This reverts commit a2ab93666d.

Reason for revert: Fixed SdkSandboxManagerTest by preserving
existing R8 compat mode for the aosp variant of SdkSandbox target.

Bug: 215530220
Bug: 293177283
Test: atest SdkSandboxManagerTests && \
      atest SdkSandboxStorageHostTest && \
      atest SdkSandboxLifecycleHostTest

Change-Id: If5636638875b6f67e0cc0ba4fd253a8d99d8db1d
2023-07-31 22:11:00 +00:00