Commit graph

267 commits

Author SHA1 Message Date
Cole Faust
6aaa55d11a Remove "exported" ninja variables am: 8982b1c49e am: 50b1f9bd53
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3031205

Change-Id: Ib94fb0c07106eb2ae52e3f317c44656fddb9aab3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-09 20:07:31 +00:00
Cole Faust
8982b1c49e Remove "exported" ninja variables
There was infrastructure to export ninja variables to bazel. Now that
the bazel migration is cancelled, we don't need it anymore.

Bug: 315353489
Test: m nothing
Change-Id: I298cc2ac7ebd004557be3b30d75f7357cab0b7a0
2024-04-09 09:42:37 -07:00
Sorin Basca
6c47e664cc 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 12:31:30 -07:00
Sam Saccone
3379d4e3d8 Merge "Revert "Switch to JDK 21"" into main am: bfa20d7e15 am: e93ae387e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2994633

Change-Id: Ibe79e815e6002c57e49794b2ebadd858dc5ccc57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-11 18:59:35 +00:00
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
Treehugger Robot
b08153e781 Merge "Switch to JDK 21" into main am: 092c3a56fb am: f30930f404
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2920125

Change-Id: I5e89bce53c531700ad958fb583b2594e4d9168f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-08 19:36:23 +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
Yangfan Deng
42a815d586 Merge "Add wear-sdk.impl to the InstrumentFrameworkModule list so that classes for wear-sdk.impl library can be exported inside jacoco-report-classes-all.jar" into main 2024-03-07 01:32:53 +00:00
yangfan deng
a90cd1e4b8 Add wear-sdk.impl to the InstrumentFrameworkModule list so that classes for wear-sdk.impl library can be exported inside jacoco-report-classes-all.jar
Ignore-AOSP-First: internal-only projects

Test: http://go/forrest-run/L55500030002341444
Bug: 298469315

Change-Id: Ib0943e8d472ee3005a6e240c83462b054c72f199
(cherry picked from commit 8e5dfaa98985a267278f17cf1600e3fb3668cfc5)
2024-03-06 05:39:19 +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
Treehugger Robot
a6ba24bcfe Merge "Remove HideFlaggedApi() related logic and the related product variables" into main am: c0412f5d31 am: bd44b17537
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2911028

Change-Id: I1b06464b5784e64825ffa81209971ba944b4be8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 01:42:48 +00: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
2278472256 Merge "Remove setting com.android.tools.r8.emitRecordAnnotationsExInDex" into main am: c97dfe42b9 am: fa139b17f9 am: b06eeb51fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2881155

Change-Id: I3947862f85ad3ebc12d571fc88a162e70491d46c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 11:50:45 +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
Colin Cross
039d8dfb67 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.

Ignore-AOSP-First: merge conflict
Bug: 284023594
Test: TestAndroidResourceProcessor
Change-Id: I026073b40dabcfdb10e5d7a52e9348205b0e9a66
2023-07-20 21:39:37 +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