Commit graph

257 commits

Author SHA1 Message Date
Sorin Basca
7f4fa82732 Merge "Revert^2 "Switch to JDK 21"" into main 2024-03-11 18:40:04 +00:00
Sorin Basca
5dfa238f22 Revert^2 "Switch to JDK 21"
This reverts commit b832ae19d8.

Reason for revert: Reland Switch to JDK 21 when related issues are resolved.

Bug: 313924276
Change-Id: Ibb5031d9892d1ddc5bc4d2af9885c3192b8ac8ad
Test: TH
2024-03-11 17:23:06 +00:00
Sam Saccone
bfa20d7e15 Merge "Revert "Switch to JDK 21"" into main 2024-03-11 17:05:56 +00:00
Sorin Basca
b832ae19d8 Revert "Switch to JDK 21"
This reverts commit 5a2e36b755.

Reason for revert: Preparing revert to have it ready in case of breakages relating to using JDK 21.

Change-Id: I153c4933f6891c7fff43e522a4d128acad6b6d47
2024-03-07 21:22:00 +00:00
Treehugger Robot
092c3a56fb Merge "Switch to JDK 21" into main 2024-03-07 19:36:28 +00:00
Sorin Basca
5a2e36b755 Switch to JDK 21
Bug: 313924276
Test: n
Change-Id: Ia9682181a6ce35ed0102d60bf7df1def8f876fd0
2024-02-29 11:44:09 +00:00
Xin Li
14a55a9b82 Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: I763b033f0f5f275091db45ab62df6af48dcddc66
Change-Id: I65077e51b4a073f2628fb0995e80ad64368def26
2024-01-30 10:34:06 -08:00
Jihoon Kang
78b6b30aec Remove HideFlaggedApi() related logic and the related product variables
With the recent build changes to support generating mainlin module sdk
with flagged apis, the build no longer depends on the values of these
product variables in exposing the flagged apis, but these are determined
by the aconfig flags. Given that these variables are no longer used,
this change removes these variables and the variables dependent code.

Test: m nothing --no-skip-soong-tests
Bug: 320515715
Change-Id: I6af94da73cc7fc7ffce670928aad81cec5d383b4
2024-01-16 20:20:27 +00:00
Søren Gjesse
8a5b32d0cf Remove setting com.android.tools.r8.emitRecordAnnotationsExInDex
System property was removed in
https://r8-review.git.corp.google.com/c/r8/+/82140, as the
system property com.android.tools.r8.emitRecordAnnotationsInDex
is the only system property for not desugaring records.

Test: Existing
Fixes: b/316501817
Change-Id: I057a18c9e02a99365e910d3128890fd481e93541
2023-12-19 10:49:58 +01:00
Treehugger Robot
aca0c185fc Merge "Use --revert-annotation instead of --hide-annotation" into main am: 550a0dab0d am: f384a08950 am: 0e02a14a2b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2870808

Change-Id: If0e5da2148bc51ae4b952f47f92f6b941cbeb7bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 03:01:10 +00:00
Paul Duffin
7ac943f7e1 Use --revert-annotation instead of --hide-annotation
Use of `--hide-annotation android.annotation.FlaggedApi` was always an
intermediate solution until the required semantics for `@FlaggedApi`
was determined. The `--revert-annotation` option provides those
semantics. When the `@FlaggedApi` is applied to an existing API, e.g.
because it has moved from system to public, or because it has changed
in some way, e.g. modifiers, then the correct semantics for when that
API is not required is not to hide the API but to revert it to what it
was before the change necessitating the `@FlaggedApi` annotation was
made.

Use --revert-annotation instead of --hide-annotation

Use of `--hide-annotation android.annotation.FlaggedApi` was always an
intermediate solution until the required semantics for `@FlaggedApi`
was determined. The `--revert-annotation` option provides those
semantics. When the `@FlaggedApi` is applied to an existing API, e.g.
because it has moved from system to public, or because it has changed
in some way, e.g. modifiers, then the correct semantics for when that
API is not required is not to hide the API but to revert it to what it
was before the change necessitating the `@FlaggedApi` annotation was
made.
Use --revert-annotation instead of --hide-annotation

Use of `--hide-annotation android.annotation.FlaggedApi` was always an
intermediate solution until the required semantics for `@FlaggedApi`
was determined. The `--revert-annotation` option provides those
semantics. When the `@FlaggedApi` is applied to an existing API, e.g.
because it has moved from system to public, or because it has changed
in some way, e.g. modifiers, then the correct semantics for when that
API is not required is not to hide the API but to revert it to what it
was before the change necessitating the `@FlaggedApi` annotation was
made.

Bug: 314196587
Test: ./gradlew
Change-Id: Ic97f29dd2b9f598ba0851f5f622c2a2724f18037
2023-12-13 00:33:25 +00:00
Colin Cross
5c298e2c36 Merge "Remove ConvertWithBp2build implementations" into main am: a72573a727 am: cd4b2f21cd am: 8bb537ba9c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2864663

Change-Id: I86ea781dcc4761078a49ee825c47d11fde9d91be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-12 00:29:45 +00:00
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Treehugger Robot
33658590bc Merge "Support experimental building with OpenJDK 21" into main am: 8f7ee30d21 am: 26539fd5e8 am: a334a87934
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2853425

Change-Id: Iace8a28440c7ca1d374465b761abeddaa9b16e8b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 22:16:43 +00:00
Sorin Basca
0760c89882 Support experimental building with OpenJDK 21
Use EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN=true to build with OpenJDK 21
while still targeting java language version 17.

Bug: 313924276
Test: m EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN=true
Change-Id: Idc892bb7519e597f1e280ca0765c1a281bb29955
2023-11-29 19:13:55 +00:00
Anton Hansson
eaaaee2ca4 Merge "Re-enable the AnnotationExtraction error" into main 2023-11-17 16:25:29 +00:00
Anton Hansson
a6ae274e3b Re-enable the AnnotationExtraction error
This prevents errors in typedef definitions. Re-enable it.

Ignore-AOSP-First: This error is not being re-enabled in AOSP yet
Bug: 309971481
Test: m checkapi
Change-Id: If9f0e580cda62d0021e82b1831746b3d15d1bfbd
2023-11-10 16:19:27 +00:00
Anton Hansson
d972a088d9 Re-enable the InvalidNullabilityOverride check
It's been disabled previously due to pre-existing failures. Baseline
those and remove the disabling.

Ignore-AOSP-First: This error is not being re-enabled in AOSP yet
Bug: 222738070
Test: m checkapi
Change-Id: I3382152186d7d8f63da7c1cc95d3ef962f422642
2023-11-10 09:57:55 +00:00
Anton Hansson
b3a9fcf664 Re-enable the bannedThrow check
It's been disabled previously due to pre-existing failures. Baseline
those and remove the disabling.

Bug: 222738070
Test: m checkapi
Ignore-AOSP-First: This error is not being re-enabled in AOSP yet
Change-Id: Ia4f91f1470a5bce332df1896b81550276c4b174d
2023-11-09 10:06:04 +00:00
Anton Hansson
59ef1ec1f5 Stop suppressing the ChangedDefault error
This will prevent future breakages of this kind, so reenable the check.

Bug: 223382732
Test: m checkapi
Change-Id: I5e67ed45e3a78b90de6884a0d7b0b1c91d58b6f5
2023-11-07 15:44:14 +00:00
Colin Cross
f059b2f2fc Remove obsolete java version environment variables
jdk9 and jdk11 are no longer used, remove ANDROID_JAVA9_HOME and
ANDROID_JAVA11_HOME.

Bug: 221270882
Test: treehugger
Change-Id: Iad566bff21055c5e2acd62642ccd579507e21fef
2023-11-01 20:58:30 +00:00
Liz Kammer
e09e20ec47 Share constants for droidstubs btw Soong & Bazel
Test: m bp2build && verify constants
Change-Id: I04865414fb627672821b10d8bcc736379dc3da86
2023-10-17 09:10:08 -04:00
Liz Kammer
e10fef75f1 Remove unnecessary flag for Kotlin compiles
This has been fixed in upstream Kotlin

Test: add /tmp/build.txt file and m metalava
Change-Id: I6d088548ee5a31452ad637bbdd75e26c8863926d
2023-10-04 10:37:05 -04:00
Colin Cross
4eae06dcc9 Move android_library resource handling to Bazel's ResourceProcessorBusyBox
The R.Java files generated by aapt2 link --no-static-lib-packages
cause scaling problems by combining all resources into every package
listed in a dependencies' AndroidManifest.xml file.  For SystemUI-core
this results in 74 R.java files, each with 76k lines, and takes 20
seconds to compile in javac.

Both AGP and Bazel have workarounds for this that avoid using the
R.java files generated by aapt2, instead generating more efficient
R.class files directly based on the R.txt file.

Bazel uses the ResourceProcessorBusyBox tool that is already present
in our tree to process the resources.  Reuse the same tool in Soong
to create the R.jar.

The more efficient R.class files require modifiying source files
that use incorrect packages to refer to resources.

Bug: 284023594
Test: TestAndroidResourceProcessor
Change-Id: I026073b40dabcfdb10e5d7a52e9348205b0e9a66
Merged-In: I026073b40dabcfdb10e5d7a52e9348205b0e9a66
2023-07-25 21:30:21 +00:00
Jihoon Kang
6c0df88809 Cleanup remaining android.JavaApiLibraryName() references
Since the name of the java_library generated from sdk_library per api
scope does not depend on the build configuration anymore, all
dependency switching "magic" via android.JavaApiLibraryName() can be
removed.

This change also removes from-text-build-specific test cases, as those
test cases depend on build configurations.

Test: m nothing && m nothing --build-from-text-stub
Bug: 287340610
Change-Id: I3bac35259e0cbaa16432a46cb2b128951c9bc075
2023-06-15 19:42:34 +00:00
Jared Duke
3e65f2a53c Increase R8 max heap size to 4GB
The size was increased for D8 in an earlier change, but is more
critical for R8. Match the D8 configuration.

Bug: 241220562,283888124
Test: m
Change-Id: I3b98bf6098f2196c87a97f6c8f7308d9299170d8
2023-05-23 17:32:30 +00:00
Jihoon Kang
b507831b71 Utilize from text core platform api surface jar in build
Use JavaApiLibraryName function to redirect the usage
of core platform api stubs from .txt files based on config.

Test: m --build-from-text-stub
Change-Id: I926a0a455fed301ba4ff9dfa509d4dbbbd076029
2023-04-06 18:34:32 +00:00
Victor Chang
397e7e2e89 Add com.android.tools.r8.emitRecordAnnotationsExInDex flag
It enables annotations for record components.

Bug: 272698028
Test: m droid
Change-Id: I9b45526c2dcdb2de458d874a0c222108a69eee71
2023-03-31 11:01:41 +01:00
Sorin Basca
de8d7a2f39 Enable annotations for sealed classes
Bug: 233029164
Test: m
Test: atest ClassTest
Change-Id: I688d86404adf5bcce9df8324d4775f73056d44d4
2023-03-11 09:15:08 +00:00
Sorin Basca
93bca1585e Merge changes from topic "java17-record-support"
* changes:
  Allow java.lang.runtime in boot image
  Emit record annotation
2023-03-03 15:12:28 +00:00
Cole Faust
a5f64f0396 Convert RuleBuilder to static rule in buildRuleToGenerateIndex
This saves ~34kb from the build.ninja file.

Test: Presubmits
Change-Id: I8fa4974e4f1509be7938c774e536d15a63534753
2023-02-14 17:50:31 -08:00
Sorin Basca
cc9eee0af2 Emit record annotation
Test: m
Change-Id: Ic1aae5c8f9fbf46293dc7e97e2951be3f11f4bbb
2023-02-10 07:30:51 +00:00
Jared Duke
6587cecab3 Remove R8-specific flags from soong config
Instead, move them to R8Wrapper. Having all of these R8-specific flags
in a single location, bundled within the R8 repo, is easier to maintain.
This should be a no-op for generated code.

Test: m + validate identical dex output
Change-Id: Ibdeecef8ca5d311d353dd623c73fab608ccd2681
2023-01-31 12:45:00 -08:00
Jared Duke
a1b8b9bab9 Enable same-file policy for R8 optimizations
While this does increase dex size for optimized targets by limiting the
scope of class merging, it also
  1) improves actionability of unretraced stack frames
  2) improves accountability for size increases
  3) tends to decrease compiled code sizes for impacted targets
  4) marginally (~1%) decreases RSS

Improvements in tooling should mitigate (1) and (2), and more targeted
use of @NeverInline can mitigate (3). Until such time, the pros seem to
outweigh the cons, so we enable the policy as a temporary measure.

Bug: 264916934
Test: m
Change-Id: Id63a17955692b75b16c42d9c85b55bae409c0da4
2023-01-27 11:25:26 -08:00
Qing Shen
871c6f32dd Instrument ims-common for coverage
Bug: 257128599

Change-Id: Ib75fce4582da51d01762f0d338308c4f2410c562
2022-11-04 22:39:56 +00:00
Treehugger Robot
d1c40db794 Merge "Revert "Pin javadoc to JDK 11"" 2022-10-17 21:47:49 +00:00
Sorin Basca
4ad3dc66c3 Revert "Pin javadoc to JDK 11"
Revert submission 2211596

Reason for revert: No longer needed after aosp/2215568

Change-Id: Ia770525501d89baa25e22c2df4fb098d056743f6
2022-10-17 07:56:00 +00:00
Cole Faust
5aab68524c Bump up errorprone heap size
ag/19500070 causes errorprone to fail with out of memory errors.
Also in aosp/2215048 the regular javac heap sized was increased
to 4096MB, so the errorprone heap size wasn't any larger anymore.

Bug: 240473481
Test: m RUN_ERROR_PRONE=true SystemUIGoogleScreenshotTestsLib on internal master
Change-Id: Ie6bdce9f2e7620c076213f4c3313960fd537967b
2022-10-14 15:54:13 -07:00
Sorin Basca
7e094b33b7 Revert^2 "Use the toolchain from JDK 17"
This reverts commit be3a561aac.

Reason for revert: Reland switch to JDK 17
Bug: 233029164
Test: TH

Change-Id: Ifa69e3fd50b853153a9c23756269ff12e72d7e9f
2022-10-05 08:23:17 +00:00
Ken Sun
be3a561aac Revert "Use the toolchain from JDK 17"
Revert submission 2164342-use-jdk17

Reason for revert: DroidMonitor-triggered revert due to breakage b/250426490

Reverted Changes:
Ib1a24e7ea:Update path for libjli.so
I3375bd4e4:Use the toolchain from JDK 17
I9183e5511:Use the toolchain from JDK 17

Change-Id: I28fc32290dd337b7d44bb98bc52956ee84f01aaa
2022-10-03 03:12:41 +00:00
Sorin Basca
8eac0005c6 Use the toolchain from JDK 17
Bug: 233029164
Test: m
Change-Id: I3375bd4e4186c0049490ee3ddc0f85552d25b579
2022-09-29 11:34:52 +01:00
Rico Wind
6008155960 Merge "Add soong support for resource shrinking" 2022-09-24 05:19:33 +00:00
Rico Wind
351bac996c Add soong support for resource shrinking
This adds a new flag to the optimize section to allow invoking the resource shrinker

Bug: 246217952
Test: m
Change-Id: I2e7851af1189db2a6adf6f9f9f444a1d7f3a8d60
2022-09-23 19:11:11 +02:00
Sorin Basca
a1073a5ab5 Increase javac heap to 4096M
Bug: 246361502
Test: TH
Change-Id: I787871a8fe924857cde550700acd15682b924b8b
2022-09-14 11:33:58 +01:00
Sorin Basca
198c51c868 Pin javadoc to JDK 11
Bug: 240421555
Test: m sdk
Change-Id: I6fed538a3a0d05a3115dd930b860aa7769aa6d16
2022-09-08 17:15:18 +01:00
Cole Faust
bcc3d05aba Fix module-file name collisions
Bazel doesn't allow a module and file with the same name.

Bug: 198619163
Test: Presubmits
Change-Id: Ie9731b627945d2ff221d3a5d08a32a5a172f9dcd
2022-09-01 15:20:00 -07:00
Jordan Demeulenaere
c33f79996f Increase R8 max heap size to 4GB.
Bug: 241220562
Test: Manual
Change-Id: I983ded61b3a588e3d3b5c8e71596f80aaa2d59e6
2022-08-08 11:40:15 +02: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
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
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