Commit graph

7466 commits

Author SHA1 Message Date
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
Spandan Das
fae468ef14 Move validation from FindDeapexerProviderForModule to rdeps
FindDeapexerProviderForModule raises an exception if multiple apexes in
the tree has an export dep on the java module. In prepartation to
support multiple prebuilts, move this error check out of
FindDeapexerProviderForModule and into rdeps. i.e. raise an exception
only if an rdep calls DexJarBuildPath

- This should be a no-op for now.
- In the short-term future, a java import module will be allowed to have
  multiple deapexers. An error will be raised if anyone actually tries
  to depend on the dexjar
- In the long-term future, this function will be removed. All processing
  will be done at the prebuilt apex level and not at the prebuilt java
  library level

Since this check now happens in the moduleCtx of rdeps, add some
additional props to unit tests to ensure that it does not exit early on
unrelated validation checks (e.g. hidden_api prop is not set)

Test: go test ./apex ./java
Bug: 308790457

Change-Id: I3323d993c1ea8f43305834cae8e65b6fe41dfefd
2023-12-18 23:19:47 +00:00
Spandan Das
2069c3f74d Move dexpreopt processing from java_*_import to prebuilt_apex
dexpreopt of apex system server from prebuilts involves three soong
modules
1. prebuilt_apex / apex_set
2. an internal deapexer module created by the prebuilt apex
3. java_import/java_sdk_library

(3) acts as a shim for the deapexer to set the dexjar extracted from the
prebuilt apex. This methodolody requires a 1:1 correspondence across the
three modules

This breaks down when we have multiple versions of the same prebuilt
apex in the tree. In preparation for this, move the dexpreopt
processing from (3) to (1). Each prebuilt_apex will create the necessary
rules for dexpreopting the jars deapexed from itself. In the future,
apex_contributions will be used to pick which service-foo.{odex|.vdex} to
install depending on which prebuilt apex is selected.

Implementation details
- Embed dexpreopter in prebuiltApex structs so that this module type can
  register the dexpreopt rules. Since a single apex can have multiple
  system server jars, this also requires creating an additional scope in
  dexpreopt.go to prevent name collisions
- Add the dexpreopt modules as required in initApexFilesForAndroidMk
- Add the depreopt modules to androidMk in AndroidMkEntries. Drop the
  equivalent from java_import and java_sdk_library_import

Bug: 308790457
Test: existing soong unit tests
Test: lunch cf_x86_64_phone-next-userdebug && m out/target/product/vsoc_x86_64/system/apex/com.google.android.adservices.apex
Test: Verified that the above command installs
/out/target/product/vsoc_x86_64/system/framework/oat/x86_64/apex@com.android.adservices@javalib@service-adservices.jar@classes.{odex|vdex} and the equivalent files of service-sdksandbox

Test: presubmits

Change-Id: I01cea8956d2857fb864b415e73d3d2686d069b5e
2023-12-18 23:17:26 +00:00
Dan Shi
7022550d0e Revert^6 "Enable dex container (DEX v41) for the whole system"
This reverts commit a33691288e.

Reason for revert: b/316609623

Change-Id: I7438f3e55a29cf07da907d04a97b1f7bcc85956c
2023-12-15 21:37:53 +00:00
Chris Antol
6482cb97cd Merge "Revert^5 "Enable dex container (DEX v41) for the whole system"" into main 2023-12-15 19:01:34 +00:00
Chris Antol
a33691288e Revert^5 "Enable dex container (DEX v41) for the whole system"
This reverts commit d45836eb38.

Reason for revert: Still breaks tests

Bug: 314212435
Change-Id: I35867878c9a8b2aa3d64092a5326c42191569adc
2023-12-15 18:15:51 +00:00
David Srbecky
a6bc7c87bd Merge "Revert^4 "Enable dex container (DEX v41) for the whole system"" into main 2023-12-15 13:05:51 +00:00
Colin Cross
5a37718c95 Convert ModuleProvder to generic providers API
Convert all of the callers of ModuleProvider/ModuleHasProvider to use the
type-safe android.SingletonModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
2023-12-14 16:12:22 -08:00
Colin Cross
313aa5475f Convert OtherModuleProvider to generic providers API
Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider
to use the type-safe android.OtherModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
2023-12-14 16:12:22 -08:00
Colin Cross
ff694a8c88 Convert Provider to generic providers API
Convert all of the callers of Provider/HasProvider to use the type-safe
android.ModuleProvider API.

Bug: 316410648
Test: builds

Change-Id: I73479de1625fa2865b6c73444cd477e50d56dc5a
2023-12-14 16:12:21 -08:00
Colin Cross
402130276c Convert SetProvider to generic providers API
Convert all of the callers of SetProvider to use the type-safe
android.SetProvider API.

Bug: 316410648
Test: builds
Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
2023-12-14 16:12:20 -08:00
Colin Cross
bc7d76cca2 Convert NewProvider/NewMutatorProvider to generic providers API
Convert all of the callers to NewProvider and NewMutatorProvider
to use a generic type parameter instead of an example object.

Bug: 316410648
Test: builds
Change-Id: Ic9cdafc87336e26730d3fd596df05de0e7267542
2023-12-14 16:12:20 -08:00
Colin Cross
3c0a83d19f Use generics for providers API
Using generics for the providers API allows a type to be associated
with a ProviderKey, resulting in a type-safe API without that doesn't
require runtime type assertions by every caller.

Unfortunately, Go does not allow generic types in methods, only in
functions [1].  This prevents a type-safe API on ModuleContext, and
requires moving the API to be functions that take a ModuleContext as
a parameter.

This CL creates the new API, but doesn't convert all of the callers.

[1] https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-parameterized-methods)

Bug: 316410648
Test: builds
Change-Id: I3e30d68b966b730efd968166a38a25cc144bd6de
2023-12-14 16:12:20 -08:00
Colin Cross
e8eeec913f Fix TestAarImportProducesJniPackages/aar-no-jni
TestAarImportProducesJniPackages was attempting to assert that an
aar_import module always had a JniPackageProvider, but was instead
asserting that the return type was always a JniPackageInfo.  Since
ModuleProvider returned the zero value of JniPackageInfo even when
there was no provider that was always true.

Fix aar_import to always set JniPackageProvider.

Test: TestAarImportProducesJniPackages
Change-Id: Idaf106e14373490d4eb807892e174aaaf094bbcf
2023-12-14 16:12:20 -08:00
Cole Faust
c01104234e Merge "Allow compile_data on all java modules" into main 2023-12-14 21:44:46 +00:00
Cole Faust
2b64af861a Allow compile_data on all java modules
art java_test modules need to specify compile_data, make it common
to all java modules.

Bug: 307824623
Test: m lint-check
Change-Id: I68640f14137f9cadaf0c454d3b5abc9e2d1d9b4b
2023-12-13 18:22:18 -08:00
Yu Liu
6dc93f9a09 Properly package aconfig files for vendor partition
Bug: 311173471
Test: Unit tests
Change-Id: Ibb857b69c3f83326a9ff5732e11dd09887e4ba6e
2023-12-14 01:19:35 +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
a72573a727 Merge "Remove ConvertWithBp2build implementations" into main 2023-12-11 23:12:53 +00:00
Treehugger Robot
b49f038231 Merge "Add compile_data for android apps" into main 2023-12-11 19:25:20 +00:00
Tor Norbye
2624653aa9 Merge "303434307: Enable flagged API checking" into main 2023-12-11 18:14:56 +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
Cole Faust
df1efd7251 Add compile_data for android apps
Compile_data is a property on rust rules to declare extra files
that are used by the compiler. In rust's case this happens commonly
with `include_str!()`.

Other compilers like javac or aapt2 don't often reach out to other
files, so it's not as neccessary. But they will follow symlinks.
We're making a change to only include symlinks themselves in sbox
sandboxes, and the targets of the symlinks must be listed
explicitly. For this, we need compile_data to list the targets
of symlinks.

Bug: 307824623
Test: m out/soong/.intermediates/frameworks/base/tools/aapt2/integration-tests/SymlinkTest/AaptSymlinkTest/android_common/lint/lint-baseline.xml with the symlink change
Change-Id: I33eb9cbe4b6eb25e3f33ea0ac9dade88c3d4a624
2023-12-08 12:34:42 -08:00
Cole Faust
558e2bd19c Merge "Fix typo in the comment" into main am: 2237d24894
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2865414

Change-Id: I6ecf98ae6cd00dc10518716673acea89f7114f2c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-08 18:09:10 +00:00
Cole Faust
2237d24894 Merge "Fix typo in the comment" into main 2023-12-08 17:32:43 +00:00
Tor Norbye
cabafdeee0 303434307: Enable flagged API checking
Also downgrade the new UseSdkSuppress check from error to warning.
And temporarily downgrades FlaggedApi from error to warning until
existing violations are resolved.

Test: The build
Bug: 303434307
Change-Id: Id7802621d567815470dee1aeb815abe214f098cd
2023-12-08 15:44:20 +00:00
Jihoon Kang
1ed5d5ca20 Merge changes from topic "aconfig_dump_map" into main am: 25c187cc7d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2854663

Change-Id: I0d9212e36959c7964e6cbff7228b5ff5dabad32a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-08 10:27:20 +00:00
Yuichiro Hanada
e42ac1c79b Fix typo in the comment
Bug: None
Test: m soong_docs and check the generated soong_build.html

Change-Id: I72dd87915f8f5225600365d8ef3f6b9c337a5dbc
2023-12-08 12:23:15 +09:00
Jihoon Kang
84b2589e6d Add aconfig flag support for android_app
This change adds an overrideable property flags_packages to android_app,
which is used to list the aconfig_declarations module names that the app
depends on. The build action of android_app is modified to pass all
flags text file provided by the aconfig_declarations to aapt2 link as
--feature-flags arguments.

Test: m nothing --no-skip-soong-tests
Bug: 306024510
Change-Id: I4924f88b9954950cc1936a472cd7ac70f41add5d
2023-12-07 23:01:26 +00:00
Colin Cross
4c803a0355 Merge aconfig files per-module am: d788b3e6cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2860765

Change-Id: Ie43ca8826156ff580618cdeda0337db270a82e62
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-07 22:37:13 +00:00
Colin Cross
d788b3e6cb Merge aconfig files per-module
Passing the list of all transitive aconfig files to Make causes extra
Kati analysis runs when dependencies are changed in Android.bp files.
Since Make is going to merge them anyways, merge them per-module and
pass a single aconfig file to Make for each module.

Fixes: 313698230
Test: m out/target/product/vsoc_x86_64/system/etc/aconfig_flags.pb
Change-Id: Ifde4826bc93bc06e40338f72b4cb39eed26ca08d
2023-12-07 04:17:37 +00:00
Aditya Choudhary
d798f5c879 Merge changes from topic "code_metadata" into main am: 4c3e2df157
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2852607

Change-Id: Icc9c1eda9b93e1ec897425b98cb8f16f83431409
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-06 08:11:06 +00:00
Aditya Choudhary
7d37796d24 Add Code Metadata rule to soong/testing. am: 8094b6bf9d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2786121

Change-Id: I40154b3f9d2c170cb7aacbf6f0b9383b2e87f444
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-06 08:11:01 +00:00
Aditya Choudhary
26df39fe44 Add source file provider for genrule/srcs, python libraries and rust libraries.
Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
2023-12-05 19:56:26 +00:00
Aditya Choudhary
8094b6bf9d Add Code Metadata rule to soong/testing.
This Cl adds a new rule to Soong to generate code ownership metadata. Also, this CL adds a provider in the Java SDK library to provide generated source files to the Code_metadata rule. Will add providers to other libraries in the future changes.

Bug: 296873595
Change-Id: Ic2e43aa9b161231fea4416d1f0d36b778361d7c5
2023-12-05 18:10:03 +00:00
David Srbecky
d45836eb38 Revert^4 "Enable dex container (DEX v41) for the whole system"
This reverts commit 0968a93679.

Reason for revert: Reland

Change-Id: I78a0097b9bea6da83dbab2fd507670bbf2edab35
2023-12-05 12:01:40 +00:00
Colin Cross
078254139c Merge "Add TestContext parameter to ContentFromFileRuleForTests" into main am: 2998c33d43
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2817720

Change-Id: Iaf65c68d8c427a5d991401f85bd1c220b2303a9b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-05 01:37:56 +00:00
Colin Cross
2998c33d43 Merge "Add TestContext parameter to ContentFromFileRuleForTests" into main 2023-12-05 00:29:10 +00:00
Colin Cross
f61d03d241 Add TestContext parameter to ContentFromFileRuleForTests
The next CL will need a TestContext parameter in
ContentFromFileRuleForTests in order to retrieve the file rule contents
from the Config.  Add it and update all the tests that use it in order
to simply review of the next CL.

Bug: 306029038
Test: go test ./...
Change-Id: Ia4b4c9854017ea3472fa2f8ba42cf7f72720496e
2023-12-03 17:22:56 -08:00
Serdar Kocdemir
96e84f84ac Merge "Revert^3 "Enable dex container (DEX v41) for the whole system"" into main am: 3d11d51733
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2852551

Change-Id: Ideb430cdb884fde634ff497108ba63228e3bc3f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 16:22:21 +00:00
Serdar Kocdemir
3d11d51733 Merge "Revert^3 "Enable dex container (DEX v41) for the whole system"" into main 2023-12-01 15:39:47 +00:00
Serdar Kocdemir
0968a93679 Revert^3 "Enable dex container (DEX v41) for the whole system"
This reverts commit e4d0e949ce.

Reason for revert: test monitor b/314212435 

Change-Id: I53cd60d82f432d4eff132b5ee28227ece1ded7af
2023-12-01 13:33:11 +00:00
David Srbecky
0cc9d2673f Merge "Revert^2 "Enable dex container (DEX v41) for the whole system"" into main am: 8e1efb7fc5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2853426

Change-Id: I9f247846eb500eeee8cadae6e8f6b2cd9dc58aa8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-30 23:42:04 +00:00
David Srbecky
8e1efb7fc5 Merge "Revert^2 "Enable dex container (DEX v41) for the whole system"" into main 2023-11-30 22:50:55 +00:00
Yu Liu
4d6d371aee Merge "Add container property to aconfig_declarations." into main am: 9dc6b1025d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2835990

Change-Id: I462e13fb5ca1132dce4751afdd91d9b144f6a283
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-30 22:14:19 +00:00
Yu Liu
9dc6b1025d Merge "Add container property to aconfig_declarations." into main 2023-11-30 21:33:34 +00:00
David Srbecky
e4d0e949ce Revert^2 "Enable dex container (DEX v41) for the whole system"
This reverts commit 432fbfa848.

Reason for revert: Reland

Test: device boots
Change-Id: I95e2ae124c6d4a74ca5303f898583de992b15cbd
2023-11-30 15:07:01 +00:00
Colin Cross
c65780626c Merge "Don't write transitive dependencies to Android-${TARGET_PRODUCT}.mk" into main am: 556ba81849
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2842060

Change-Id: I854bc7c67d7d4525fef42b031ad0b9a9c9080643
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-30 01:26:48 +00:00
Colin Cross
556ba81849 Merge "Don't write transitive dependencies to Android-${TARGET_PRODUCT}.mk" into main 2023-11-30 00:41:43 +00:00
Treehugger Robot
26539fd5e8 Merge "Support experimental building with OpenJDK 21" into main am: 8f7ee30d21
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2853425

Change-Id: I9bcd13d2b770982a638b41cd82284c96e8293186
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 21:19:28 +00:00
Treehugger Robot
8f7ee30d21 Merge "Support experimental building with OpenJDK 21" into main 2023-11-29 20:25:25 +00:00
Ramya Subramanian
ff5cf349f5 Merge "Revert "Enable dex container (DEX v41) for the whole system"" into main am: 29e05d1007
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2853365

Change-Id: Iecfcf43f2809a8249c59adeb8092902152f61b51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 19:54:32 +00:00
Ramya Subramanian
29e05d1007 Merge "Revert "Enable dex container (DEX v41) for the whole system"" into main 2023-11-29 19:38:50 +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
Ramya Subramanian
432fbfa848 Revert "Enable dex container (DEX v41) for the whole system"
This reverts commit b82a2a278b.

Reason for revert: DroidMonitor: Potential culprit for multiple Module failures on ATH. verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.”.

Change-Id: I3899a45cce259c4ee38572e76f4735eccb3ca66a
2023-11-29 18:34:31 +00:00
Colin Cross
312634eb0f Don't write transitive dependencies to Android-${TARGET_PRODUCT}.mk
Java libraries were writing lists of files that changed whenever
transitive dependencies changed to Android-${TARGET_PRODUCT}.mk, causing
Kati analysis to rerun whenever a dependency was changed in Soong.
In both cases, Make would immediately use the list to write a single
output file.  Write the files in Soong and pass the path to the file
to Make instead, which will both reduce the size of
Android-${TARGET_PRODUCT}.mk and skip Kati analysis more often.

Bug: 309006256
Test: m checkbuild
Change-Id: I5dff16c6fb7cca8c6da927b37c612c7b1d0954e6
2023-11-29 10:31:13 -08:00
Anas Sulaiman
7eb74575b5 Merge "allow specifying remote caching opt for rewrapper" into main am: 80117e6c4f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2838517

Change-Id: I3d3a9a4a05d364ac88277e6a0e2e9904c21e467d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 18:07:57 +00:00
Anas Sulaiman
80117e6c4f Merge "allow specifying remote caching opt for rewrapper" into main 2023-11-29 16:36:21 +00:00
Jiakai Zhang
36c8b1d229 Merge "Remove PreoptExtractedApk." into main am: ba45ba5763
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2848255

Change-Id: I627974d669b4e978ff555553fa94fd5bfc63f7c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 10:50:42 +00:00
Rico Wind
77379a479f Merge "Reapply "Use R8 for resource shrinking"" into main am: 2f6b403ccd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2846953

Change-Id: I787623b4073f8c550f6d94ff0855fda873167d0b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 10:50:13 +00:00
Jiakai Zhang
ba45ba5763 Merge "Remove PreoptExtractedApk." into main 2023-11-29 10:17:29 +00:00
Rico Wind
98e7fa8db1 Reapply "Use R8 for resource shrinking"
This reverts commit a9fd59a7f2.

We are moving the resource shinking pipeline into r8 (gennerally, not just for platform)

This disables the usage of the resource shrinker cli from cmd-line tools

There are no changes in this cl compared to the original land, the fix
was done in R8 (to use the same compression for res folder entries as
in the original)

Bug: 308710394
Bug: 309078004
Test: Existing, validated that resource table on SystemUI was byte<>byte equal, validated uncompression

Merged-In: Ib8a6fb128084e994325b975c46a036cb41494654

Change-Id: Id45b170dd50f75bc87e21ad03b2d0679efb7adc2
2023-11-29 05:07:50 +00:00
Treehugger Robot
66dd52b74d Merge "Enable dex container (DEX v41) for the whole system" into main am: 7d813e0dba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2238838

Change-Id: I166e8dfcb9e7ad9bfd4c4edfae56beb9215d8680
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 01:07:05 +00:00
Anas Sulaiman
9d7a36d17f allow specifying remote caching opt for rewrapper
This is needed to enable local execution via reproxy for metalava
actions for developer builds without causing permissions errors
and without disabling it for other actions.

Bug: b/308154125
Tested: ran a local build and verified all metalava actions were
executed locally without attempting to write to the remote cache.

Change-Id: Ia6f616e1ff5d0c71597ebf688765925ac81d19c3
2023-11-29 00:42:08 +00:00
Yu Liu
eae7b36699 Add container property to aconfig_declarations.
Bug: 311155208
Test: Unit test
Change-Id: I7b187138856d0144203961e82b6dad5e2f8eed9d
2023-11-28 12:37:02 -08:00
Jiakai Zhang
db93553b02 Remove PreoptExtractedApk.
This was added by r.android.com/513843 to force dexpreopt some GMS core
modules even if dexpreopt is disabled, to avoid some memory usage
regression. We no longer need it because dexpreopt is never disabled on
production builds.

Bug: 313505540
Test: m
Change-Id: I605b7569c17ee715cd4df167768e25aaf51bcd37
2023-11-28 13:40:58 +00:00
Søren Gjesse
b82a2a278b Enable dex container (DEX v41) for the whole system
Bug: b/249922554
Test: device boots
Change-Id: Idc63034cc7d5f4bc4533d1f580eeffe1494b56a6
2023-11-28 13:24:21 +00:00
David Srbecky
efb785c929 Merge "Change position of R8/D8 flags on the command line." into main am: ea5bb25378
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2845918

Change-Id: Ib2480ac6ccc8ac459cbc9f38bc8c909bf8dfc109
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-27 16:28:40 +00:00
Jamie Garside
b5429e879e Add the ability for a java_sdk_library to depend on another. am: e570ace2e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2844082

Change-Id: Iac17dd61875b799fbf6d399401beffc89d463e9c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-27 16:15:50 +00:00
David Srbecky
ea5bb25378 Merge "Change position of R8/D8 flags on the command line." into main 2023-11-27 15:44:04 +00:00
David Srbecky
bda964cf90 Change position of R8/D8 flags on the command line.
The wrapper script requires that all -J* options are passed first.

Test: m
Change-Id: Idd1da394c8a46db3485a1b31284eb6f398e3ba27
2023-11-27 14:27:45 +00:00
Jamie Garside
e570ace2e4 Add the ability for a java_sdk_library to depend on another.
This simply exports all of the uses_libs: [] libraries into a
"dependency=''" statement in the generated XML file (with the <library>
stanza in it).

Test: `go test` in java/
Bug: 184396657

NOTE FOR REVIEWERS - original patch and result patch are not identical.
PLEASE REVIEW CAREFULLY.
Diffs between the patches:
 func formattedDependenciesAttribute(dependencies []string) string {
> +	if dependencies == nil {
> +		return ""
> +	}
> +	return fmt.Sprintf(`        dependency=\"%s\"\n`, strings.Join(dependencies, ":"))
> +}
> +
> +	dependenciesAttr := formattedDependenciesAttribute(module.properties.Uses_libs_dependencies)
> +		dependenciesAttr,
> --- java/sdk_library_test.go
> +++ java/sdk_library_test.go
> +
> +func TestSdkLibraryDependency(t *testing.T) {
> +	result := android.GroupFixturePreparers(
> +		prepareForJavaTest,
> +		PrepareForTestWithJavaSdkLibraryFiles,
> +		FixtureWithPrebuiltApis(map[string][]string{
> +			"30": {"bar", "foo"},
> +		}),
> +	).RunTestWithBp(t,
> +		`
> +		java_sdk_library {
> +			name: "foo",
> +			srcs: ["a.java", "b.java"],
> +			api_packages: ["foo"],
> +		}
> +		
> +		java_sdk_library {
> +			name: "bar",
> +			srcs: ["c.java", "b.java"],
> +			libs: [
> +				"foo",
> +			],
> +			uses_libs: [
> +				"foo",
> +			],
> +		}
> +`)
> +	
> +	barPermissions := result.ModuleForTests("bar.xml", "android_common").Rule("java_sdk_xml")
> +	
> +	android.AssertStringDoesContain(t, "bar.xml java_sdk_xml command", barPermissions.RuleParams.Command, `dependency=\"foo\"`)
> +}

Original patch:
 diff --git a/java/sdk_library.go b/java/sdk_library.go
old mode 100644
new mode 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1993,6 +1993,7 @@
 		Min_device_sdk            *string
 		Max_device_sdk            *string
 		Sdk_library_min_api_level *string
+		Uses_libs_dependencies    []string
 	}{
 		Name:                      proptools.StringPtr(module.xmlPermissionsModuleName()),
 		Lib_name:                  proptools.StringPtr(module.BaseModuleName()),
@@ -2002,6 +2003,7 @@
 		Min_device_sdk:            module.commonSdkLibraryProperties.Min_device_sdk,
 		Max_device_sdk:            module.commonSdkLibraryProperties.Max_device_sdk,
 		Sdk_library_min_api_level: &moduleMinApiLevelStr,
+		Uses_libs_dependencies:    module.usesLibraryProperties.Uses_libs,
 	}
 
 	mctx.CreateModule(sdkLibraryXmlFactory, &props)
@@ -2968,6 +2970,11 @@
 	//
 	// This value comes from the ApiLevel of the MinSdkVersion property.
 	Sdk_library_min_api_level *string
+
+	// Uses-libs dependencies that the shared libra
[[[Original patch trimmed due to size. Decoded string size: 3559. Decoded string SHA1: 67fbd040aa818732a686514c4556850c8c36dc8d.]]]

Result patch:
 diff --git a/java/sdk_library.go b/java/sdk_library.go
index fb27812..fbfe509 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1993,6 +1993,7 @@
 		Min_device_sdk            *string
 		Max_device_sdk            *string
 		Sdk_library_min_api_level *string
+		Uses_libs_dependencies    []string
 	}{
 		Name:                      proptools.StringPtr(module.xmlPermissionsModuleName()),
 		Lib_name:                  proptools.StringPtr(module.BaseModuleName()),
@@ -2002,6 +2003,7 @@
 		Min_device_sdk:            module.commonSdkLibraryProperties.Min_device_sdk,
 		Max_device_sdk:            module.commonSdkLibraryProperties.Max_device_sdk,
 		Sdk_library_min_api_level: &moduleMinApiLevelStr,
+		Uses_libs_dependencies:    module.usesLibraryProperties.Uses_libs,
 	}
 
 	mctx.CreateModule(sdkLibraryXmlFactory, &props)
@@ -2968,6 +2970,11 @@
 	//
 	// This value comes from the ApiLevel of the MinSdkVersion property.
 	Sdk_library_min_api_level *string
+
+	// Uses-libs dependencies that the shared library
[[[Result patch trimmed due to size. Decoded string size: 3614. Decoded string SHA1: b5730ecbeeaad420439ddb67eaaa9150ede94585.]]]

Change-Id: I73f69e2a4573e416492f68e083fe739f3f75b721
2023-11-27 12:07:36 +00:00
Treehugger Robot
baed9d5a57 Merge "Use result.Config.PrebuiltOS() to get prebuiltHost in test_spec_test" into main am: 9be9a126d1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2841420

Change-Id: I5b7d56846f7bac5b4a77745e8638ce2412aaa935
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-22 02:06:49 +00:00
Aditya Choudhary
356296240e Use result.Config.PrebuiltOS() to get prebuiltHost in test_spec_test
Bug: 312536783
Bug: 312536905
Test: m nothing --no-skip-soong-tests -j96

Change-Id: I1e12281927269d42ae796348b223030acfd6ecfa
2023-11-21 23:14:01 +00:00
Aditya Choudhary
64b6c645e8 Add test for soong/testing/test_spec. am: b7b3de8307
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2836072

Change-Id: Iec9eeceadbd2e86055a4f2e6eecd77443f7eb05a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-21 19:44:34 +00:00
Aditya Choudhary
b7b3de8307 Add test for soong/testing/test_spec.
This CL adds test for test_spec.go and all_test_specs.go (singleton).

Bug: 296873595
Test: m nothing --no-skip-soong-tests -j96

Change-Id: I5010c68512e75d1b9a337c02da86faac15e376fe
2023-11-21 17:31:07 +00:00
David Srbecky
918285adce Merge "resourceshrinker: Add dexContainerExperiment flag" into main am: 3f7d0f6797
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2828314

Change-Id: I18e530107a0fe3c9185f86f7c69d37b49dd4e64f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-21 08:43:33 +00:00
David Srbecky
3f7d0f6797 Merge "resourceshrinker: Add dexContainerExperiment flag" into main 2023-11-21 08:30:23 +00:00
Colin Cross
7dcb26f327 Change deps of ctx.Install* from Paths to InstallPaths am: 09ad3a6505
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2834991

Change-Id: I63828eebd77e8e88592107a6e5cee9c291cacb42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-20 20:20:36 +00:00
Colin Cross
09ad3a6505 Change deps of ctx.Install* from Paths to InstallPaths
Installed files should only depend on other installed files, change
the deps arguments of the ctx.Install* methods from Paths to
InstallPaths.

Bug: 311428265
Test: builds
Change-Id: I1ebef60a943bdbe907744cc43aa985371ac56d32
Merged-In: I1ebef60a943bdbe907744cc43aa985371ac56d32
2023-11-17 19:06:43 -08:00
Inseob Kim
99913d4e59 Merge "Add support for auto-generated characteristics RRO" into main am: b5d713f2cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2817177

Change-Id: Ie4a539f9001bdbd2fc91fedbfc9869a1c35b15d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 05:43:44 +00:00
Inseob Kim
b5d713f2cb Merge "Add support for auto-generated characteristics RRO" into main 2023-11-17 05:02:28 +00:00
Inseob Kim
34dc4cd738 Add support for auto-generated characteristics RRO
Setting Generate_product_characteristics_rro will automatically generate
an RRO package which contains resources with
'product="{PRODUCT_CHARACTERISTICS}"'. The RRO package will be installed
to /product partition. The app will be compiled with '--product
default', making the app identical to all targets.

Motivation for this change is to minimize divergence of system.img.

Bug: 294799593
Test: boot and idmap2 dump
Change-Id: I1371f7410a1ecf337e1f73214b024af39aa6d57a
2023-11-17 11:15:32 +09:00
Treehugger Robot
5c8f4f446d Merge "Add contribute_to_android_api property in java_sdk_library" into main am: 7fcb470251
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2832851

Change-Id: I9be66305f8b2da9ea8026bf197f578961e088ec7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 22:45:50 +00:00
Treehugger Robot
7fcb470251 Merge "Add contribute_to_android_api property in java_sdk_library" into main 2023-11-15 22:25:22 +00:00
Colin Cross
d50b463e66 Merge "Stop collecting path entry for module_bp_java_deps.json from each module type" into main am: d7812415c3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2831928

Change-Id: I13c077e58d39a86ce14d3b89551b369d6a9cc5fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 21:19:28 +00:00
Colin Cross
d7812415c3 Merge "Stop collecting path entry for module_bp_java_deps.json from each module type" into main 2023-11-15 21:01:38 +00:00
Jihoon Kang
80456fdec4 Add contribute_to_android_api property in java_sdk_library
The default-false bool property `contribute_to_android_api` will be used to signify whether the java_sdk_library module contributes to an api
surface (i.e. listed in frameworks-base-api.bootclasspath or not).
If the property is set to true, the module's stub jar can be
generated from .txt files.

Currently, the property is a no-op. The property will be utilized in the
child changes.

Test: m nothing
Bug: 276958307
Change-Id: I617802ec352c7055579ce92ea3de43f10cac1da4
2023-11-15 20:40:37 +00:00
Colin Cross
a644c263dd Stop collecting path entry for module_bp_java_deps.json from each module type
The jdepsGeneratorSingleton can get the module path directly, it doesn't
need to be collected by each module type that implements IDEInfo.  Fixes
module types (like android_library) that didn't reach the code that
collected the path.

Bug: 309835196
Test: out/soong/module_bp_java_deps.json contains path for ExtServices.core
Change-Id: If8cb81b4f708e0367f156ade164bee253bf53492
2023-11-15 11:40:48 -08:00
Aditya Choudhary
beff7f2a0a Merge "Add proto for Test ownership metadata." into main am: d97bf36469
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2774872

Change-Id: Idae0ffe939cb25b9c8626a39d036535691ee38f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 11:19:37 +00:00
Aditya Choudhary
d97bf36469 Merge "Add proto for Test ownership metadata." into main 2023-11-15 10:30:50 +00:00
Aditya Choudhary
9b59352a82 Add proto for Test ownership metadata.
This Cl adds a new rule to Soong to generate test spec metadata. Also, this CL adds a provider in various test module to provide test spec related data to the Soong rule.
Will add providers and test code to other Module in the future changes.
Provider added for the following test modules in this change: android_robolectric_test, android_test, bootclasspath_fragment_test, java_test, java_test_host, python_test, python_test_host, sh_test,and sh_test_host.

Bug: 296873595

Change-Id: I5f89f72d5874bb7838ae357efdb8c6ca208e18a7
2023-11-15 09:08:02 +00:00
Alyssa Ketpreechasawat
4e56c8b8ac Merge "Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use." into main am: 378c7a3953
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2822393

Change-Id: Ie94799e955a6dc3d4a31c2ea0376945a2982e8fc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-14 19:44:58 +00:00
Alyssa Ketpreechasawat
378c7a3953 Merge "Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use." into main 2023-11-14 19:13:32 +00:00
David Srbecky
8f354780e6 resourceshrinker: Add dexContainerExperiment flag
Bug: 249922554
Test: build with CL/2238838
Change-Id: I369ebe616caa9ae880b71abb0bafa3f909ebcdae
2023-11-14 12:06:50 +00:00
Treehugger Robot
4aa0474c14 Merge "Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage." into main am: 34778a9301
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2822402

Change-Id: I7a3d9febdd7fbef957e3f295784776985aabf9c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-10 19:18:23 +00:00
Treehugger Robot
34778a9301 Merge "Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage." into main 2023-11-10 18:47:19 +00:00
Jiakai Zhang
2398442ec0 Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage.
OnlyPreoptBootImageAndSystemServer was for making the eng build faster.
This change makes it even faster.

Bug: 309011617
Test: Presubmit
Change-Id: If9001e99593b57deafa7b56f0ca6b3d4d80f56d3
2023-11-09 16:50:58 +00:00
Alyssa Ketpreechasawat
a0cf0a4a66 Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use.
Following aosp/2822531, when MediaProvider prebuilt is enabled, framework-pdf (new jar) will be removed from PRODUCT_APEX_BOOT_JARS. Subsequently there will be an error around the inconsistency (unknown) between bootclasspath_fragment (source version of MP with framework-pdf in its content) and PRODUCT_APEX_BOOT_JARS (framework-pdf removed). Since the source version of bootclasspath_fragment is not in use, we should ignore this check. See more detail in go/stale-mainline-prebuilts (issue from changes in framework/service jars in existing apexes).

Bug: 304719212
Test: lunch cf_x86_phone-next-userdebug & m
Test: lunch cf_x86_phone-trunk-userdebug & m
Change-Id: I0f62277a9e65522bf5a4ea1ae33c166f996c37d5
2023-11-09 12:54:09 +00:00
Spandan Das
e48000d86f Merge changes from topic "apex_contributions_build_flags" into main am: c31b24977e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808754

Change-Id: Ia7b7a22e9be58e37db8d188eff8cda2a8dc408e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 01:58:15 +00:00
Spandan Das
fc12d2f494 Special-case java_sdk_library in source vs prebuilt selection
If a java_sdk_library is listed in `contents`, then restrict the source
vs prebuilt selection superseding to only the internal stub libraries.

Defer the source vs prebuilt selection mechanism of the top-level
library to the existing mechanisms for now. This is necessary because
this top-level library acts as a hook for
- hiddenapi: boot jars are deapxed from the prebuilt apex
- dexpreopt: system server jars are deapexed from the prebuilt apex and
  installed via required

If `next` uses `framework-foo` and `service-foo` as the top-level
library instead of the prebuilt equivalents, then the bootjars installed
in out/soong/dexpreopt_x86_64/apex_bootjars will come from source. And
the *.odex files of the system server jars will come from source.

Bug: 308174768
Test: Added a java_sdk_library unit test to assert that the new
mechanism supersedes the `prefer` flag

Change-Id: Ib43198a3b547c58b54f1f0966e95584215096d32
2023-11-08 18:37:24 +00:00
Jiakai Zhang
f3c1e6f8fe Merge "Use the correct mainline BCP jars for app dexpreopt." into main am: 04445d5443
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816578

Change-Id: I533792e84af2417c260b5f9afcc6387f78eb16b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 11:26:01 +00:00
Jiakai Zhang
04445d5443 Merge "Use the correct mainline BCP jars for app dexpreopt." into main 2023-11-08 10:56:58 +00:00
Anton Hansson
ca3bfaba87 Merge "Stop suppressing the ChangedDefault error" into main am: d69b5ff1b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2818838

Change-Id: I28b3f68058d8f5e4951ef2e845906dbbe873bbfd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 10:49:28 +00:00
Anton Hansson
d69b5ff1b2 Merge "Stop suppressing the ChangedDefault error" into main 2023-11-08 10:23:42 +00:00
Anton Hansson
35f97155c7 Merge "Add a new flag to stop disabling lint errors" into main am: bf3e32d870
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816560

Change-Id: Id9090e39d1a9716be323f4689a8678c98bceefe3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-07 16:27:05 +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
Anton Hansson
fd1c0d2eaa Add a new flag to stop disabling lint errors
java_sdk_library has historically suppressed a few legitimate lint
errors. Make it possible to remove these suppressions via a flag.

Bug: 306806877
Test: checkapi
Merged-In: I10577dacbd7ea8063c6e1e02f3b6c60a2bee5094
Change-Id: I10577dacbd7ea8063c6e1e02f3b6c60a2bee5094
2023-11-07 10:14:50 +00:00
Zi Wang
e1166f081f Use ApiLevel on min, target and compile Sdk version
This change is a partial revert of aosp/2143082. The reason is
that unreleased apis should be referenced by name instead of a
number.

link to xml reports before/after this cl:
https://drive.google.com/drive/folders/1woIgVlHF6qude5RpW-0mEQLzcXo4isX4?usp=sharing

Test: m lint-check
Change-Id: I6d801f95a24400c9c5c23546e19d6440bd357873
2023-11-06 13:59:07 -08:00
Jiakai Zhang
c6879f3ddd Use the correct mainline BCP jars for app dexpreopt.
Before this change, the build system had special logic to find mainline
BCP jars and copy them to a special location for app dexpreopt. This
logic doesn't work on `next`. In fact, we don't need this logic anymore.
Since we are now generating the mainline boot image extension, we can
reference the inputs of the mainline boot image extension, which are
exactly the mainline BCP jars needed for app dexpreopt.

Bug: 309302263
Test: atest art_standalone_dexpreopt_tests (on next)
Test: m --no-skip-soong-tests nothing

Change-Id: I055018ffbc5d7e5678f305e65a7f1c7e73bf3b99
2023-11-06 18:44:52 +00:00
Alyssa Ketpreechasawat
aa91b88610 Merge "Disable verify_overlaps test instead of hiddenapi check." into main am: 98e555c842
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816955

Change-Id: I328905493dcc5c71bf88139fd80520f6259604a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 11:33:40 +00:00
Alyssa Ketpreechasawat
98e555c842 Merge "Disable verify_overlaps test instead of hiddenapi check." into main 2023-11-06 10:53:31 +00:00
Alyssa Ketpreechasawat
7daf2786b6 Disable verify_overlaps test instead of hiddenapi check.
Disabling hiddenapi check entirely can be dangerous and it might change the
accessibility of @hide Api too. We should only disable verify_overlaps
test which is required for module_sdk and apexes mismatch.

Test: atest CtsInlineMockingTestCases
Bug: 308187068
Bug: 307480026
Change-Id: I44f48e85d802b3a8f2711bc2047bdab721369f08
2023-11-06 09:49:16 +00:00
Michael Stokes
b2db840da2 Merge "Revert "Use R8 for resource shrinking"" into main am: 2e09e68e56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816956

Change-Id: Ibf81e57b1232525a43752ab7bfa5b8d3120719c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-03 12:51:21 +00:00
Michael Stokes
2e09e68e56 Merge "Revert "Use R8 for resource shrinking"" into main 2023-11-03 12:12:40 +00:00
Treehugger Robot
c080eb1d33 Merge "Update checkapi error message to provide more guidance" into main am: 0978d6a4b1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816954

Change-Id: I6a1fcce0c608632161c29eff6c73a3eccf6cf1eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-03 11:40:37 +00:00
Treehugger Robot
0978d6a4b1 Merge "Update checkapi error message to provide more guidance" into main 2023-11-03 11:13:02 +00:00
Rico Wind
a9fd59a7f2 Revert "Use R8 for resource shrinking"
Revert submission 2816534-r8resourceshrinking

Reason for revert: b/309075997

Reverted changes: /q/submissionid:2816534-r8resourceshrinking

Change-Id: Ic173491eaf22967fbad14fbcc85f6ddb2cf54d23
2023-11-03 10:26:38 +00:00
Rico Wind
fd74f8c693 Merge "Use R8 for resource shrinking" into main am: 4ea88503e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2813214

Change-Id: I830d027fdfa080ca4bd29c1e24795148a6d16649
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-03 08:09:07 +00:00
Rico Wind
4ea88503e4 Merge "Use R8 for resource shrinking" into main 2023-11-03 07:29:45 +00:00
Treehugger Robot
df1bcdca0e Merge "Remove retrieveLegacyEncodedBootDexFiles" into main am: 81ac6e74df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816477

Change-Id: Ie1ac557250fb60091e003bd3416f29955b949ea6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-03 02:15:29 +00:00
Spandan Das
3e75cfa795 Remove retrieveLegacyEncodedBootDexFiles
Seems to be an unused function

Test: TH
Change-Id: Ic0b352afc16ccaf450dadb5b13d9fb6c694e72e6
2023-11-03 00:46:29 +00:00
Jihoon Kang
3ea6467c1c Update checkapi error message to provide more guidance
With from-text stub feature, checkapi is also used for checking the
sanity of the stubs. Therefore, this change adds more explanatory
message about how the user can rebuild the target when their build
failed with stub validation after local API change.

Test: m nothing
Bug: 309027703
Change-Id: If7c9c287266f3da82edde663619b9f08ee05530d
2023-11-03 00:40:26 +00:00
Rico Wind
b56fe2825d Use R8 for resource shrinking
We are moving the resource shinking pipeline into r8 (gennerally, not just for platform)

This disables the usage of the resource shrinker cli from cmd-line tools

Bug: 308710394

Test: Existing, validated that resource table on SystemUI was byte<>byte equal.
Change-Id: Ia36b5e5970cbdcff519a5f05d672b44dc145ea32
2023-11-02 20:35:20 +01:00
Colin Cross
b6888a8b12 Don't call android.PathForModuleSrc(ctx).String() to get ModuleDir am: f96b001064
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2806397

Change-Id: I2b83356146272e1e9995124c9549c0d3292a28cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 19:23:07 +00:00
Colin Cross
f96b001064 Don't call android.PathForModuleSrc(ctx).String() to get ModuleDir
ctx.ModuleDir is much cheaper than android.PathForModuleSrc(ctx).String().

Test: builds
Change-Id: I81819088d9564b06a0336a59a45f2b110b0bd9d6
2023-11-02 19:07:49 +00:00
Jihoon Kang
12ea2d90fa Merge changes from topic "core-lambda-stubs-source" into main am: 412dc7c488
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2814994

Change-Id: I202cd89b576d1d5c5e614da28e65a80b4cfe0b87
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 17:48:23 +00:00
Colin Cross
3bc0e28180 Merge "Remove obsolete java version environment variables" into main am: f2c51919ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2814561

Change-Id: Id5ce5b6567e4bc6b1656c475390b847bdc7a46a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 17:47:27 +00:00
Jihoon Kang
412dc7c488 Merge changes from topic "core-lambda-stubs-source" into main
* changes:
  Remove TxtStubLibraries.bp
  Move core.module_lib.stubs.from-text closer to source
2023-11-02 17:08:11 +00:00
Colin Cross
f2c51919ad Merge "Remove obsolete java version environment variables" into main 2023-11-02 17:05:06 +00:00
Treehugger Robot
233ec66675 Merge "Remove sdkPreSingleton and overlaySingleton" into main am: a741e88489
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2813819

Change-Id: I4be5074e92607920fabfdda79b3d707f79e7aa25
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 04:11:01 +00:00
Treehugger Robot
a741e88489 Merge "Remove sdkPreSingleton and overlaySingleton" into main 2023-11-02 03:43:15 +00:00
Jihoon Kang
6416a71211 Remove TxtStubLibraries.bp
The modules defined in TxtStubLibraries.bp are currently not in the
critical path of the from-text stub build, because the from-text vs
from-source switching is encapsulated within the stub library modules.
Therefore, remove the modules altogether.

Test: m nothing --build-from-text-stub
Bug: 287522618
Change-Id: I249edcdf596c8a82058e1bfb17da863c2b5dd7a7
2023-11-02 01:02:40 +00:00
Jihoon Kang
bfa2f9ec69 Move core.module_lib.stubs.from-text closer to source
This change moves the core.module_lib.stubs.from-text closer to its
from-source equivalents and its top level module core/module_lib.stubs.

Test: m nothing --build-from-text-stub
Bug: 287522618
Change-Id: Ida6dd613834b36490b1ad79773b9404b1d0d9efc
2023-11-02 01:02:28 +00:00
Treehugger Robot
b98b24b053 Merge changes I7bc4d8d4,I8158c0b9 into main am: 9ae2999dab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2814560

Change-Id: Ia9de5ae8687d436b60a79c50b999fb753d90c9db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 00:16:22 +00:00
Treehugger Robot
9ae2999dab Merge changes I7bc4d8d4,I8158c0b9 into main
* changes:
  Use merge_zips instead of ziptime for resetting timestamps in jacoco outputs
  Always reset timestamps in merge_zips
2023-11-01 23:38:29 +00:00
Cole Faust
9bef67488d Remove sdkPreSingleton and overlaySingleton
These were the only 2 pre-singletons in soong. sdkPreSingleton is
totally unused. overlaySingleton can be done during
GenerateAndroidBuildActions instead.

Test: m nothing --no-skip-soong-tests
Change-Id: Ieb5ab92f18cb56be4049c0842f61df8aa02dc52c
2023-11-01 15:29:09 -07:00
Colin Cross
c8c2cee06a Use merge_zips instead of ziptime for resetting timestamps in jacoco outputs
ziptime doesn't support ZIP64 so it is limited to 65535 entries in
a zip file.  Use the newly added support in merge_zips to reset the
timestamp instead.

Bug: 308765940
Test: builds
Change-Id: I7bc4d8d4943e7417af1783a63ac5b5904d2aa751
2023-11-01 14:41:48 -07: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
Spandan Das
bfdc9a89e0 Merge "Add the name of the sdk library to dynamically generated java modules" into main am: eb852927d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808372

Change-Id: I7464d1574398c891b4bca139a4c6a8c8399c9491
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 17:48:35 +00:00
Spandan Das
eb852927d4 Merge "Add the name of the sdk library to dynamically generated java modules" into main 2023-11-01 17:31:58 +00:00
Sam Delmerico
0b74fbb608 Merge "transitive r8 flags for installable {android,java}_libraries" into main am: d9569528bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2812555

Change-Id: I9ced451bbd526c7f399ad0b247255bd7234b1dfa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 16:06:58 +00:00
Sam Delmerico
d9569528bd Merge "transitive r8 flags for installable {android,java}_libraries" into main 2023-11-01 15:29:11 +00:00
Spandan Das
2cc80ba145 Add the name of the sdk library to dynamically generated java modules
The name of the sdk library will be used in source vs prebuilt
selection. For soong modules that are not dynamically created from a
java_sdk_library, the value will be nil.

Bug: 308174768
Test: TH
Change-Id: Ic7e9889f00c6184992b663a7124967bb0794d475
2023-10-31 20:57:56 +00:00
Sam Delmerico
c8e040c70f transitive r8 flags for installable {android,java}_libraries
Only android_apps were actually applying transitive proguard flags files
to their r8 invocation. This CL ensures that this also occurs for
installable android_libraries and java_libraries.

Bug: 302342049
Test: go test ./java
Change-Id: Ie94d688d04367ee3d39e7e760fb3003df5829951
2023-10-31 18:59:04 +00:00
Alix Espino
f98019df2f Merge "add manifest_values application id property to soong" into main am: a9ead6ef2b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769927

Change-Id: I523dc527ca60db260f3405352c27fc3bacb6a0b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 14:34:34 +00:00
Alix Espino
a9ead6ef2b Merge "add manifest_values application id property to soong" into main 2023-10-31 14:17:53 +00:00
Treehugger Robot
f3d826d09c Merge "Update transitive lib propagation" into main am: 3d9ba8ff90
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808361

Change-Id: Id2bfd9d7a5387a354cf882a498c312204b0f5a28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 04:58:03 +00:00
Jared Duke
efb6d60210 Update transitive lib propagation
Only propagate transitive libs by way of library-like references. This
avoids inclusion of transitive deps from tools like lint modules that
are unncessary for R8.

This yields build speedups for a number of targets, including:
 * services.jar:            -22% (66s -> 51s)
 * telephony-common.jar:    -27% (29s -> 21s)
 * updatable-media.jar:     -41% (17s -> 10s)
 * framework-appsearch.jar: -46% (13s ->  7s)

Bug: 302383328
Bug: 307273642
Test: m
Change-Id: I60bb30e84dabe522ea9ac9333f00e739962ea91d
2023-10-27 22:48:13 +00:00
Anton Hansson
09f168dc07 Merge "Remove UnavailableSymbol from warnings to disable" into main am: 8e586ab8b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2805913

Change-Id: I1ad2f6f547b53ac3a077fdb7cdc85dc3fe55215b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-27 08:08:10 +00:00