Commit Graph

8223 Commits

Author SHA1 Message Date
Paul Duffin
8119148a45 Merge "Use new --api-lint-previous-api" into main am: a4362b937a am: 05903d700e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3051802

Change-Id: Ic3e36ba5768f18fe503b4a84ce713b6929a6e1cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-23 13:39:07 +00:00
Paul Duffin
a4362b937a Merge "Use new --api-lint-previous-api" into main 2024-04-23 13:04:16 +00:00
Rico Wind
be9baeac1e Merge "Enable non final ids for non BusyBox builds" into main am: 8a2427cad2 am: 7de3822c96
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3047121

Change-Id: Id33c41e8e2142ad8785d943d963068ddf04a70ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-23 04:34:29 +00:00
Rico Wind
8a2427cad2 Merge "Enable non final ids for non BusyBox builds" into main 2024-04-23 04:03:24 +00:00
Treehugger Robot
8b94432165 Merge "PackageFile for permission/*.xml for sdk_library" into main am: b0a4e48c15 am: 0a8f7741fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3053562

Change-Id: Ib9d5fb0fc90cf6a0dfcdd7ee121e7f1cc73b22d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-22 23:29:15 +00:00
Treehugger Robot
c0dcd31b8b Merge "Include stubs type in metalava.rsp filename" into main am: affbd19c64 am: ee421a7c5f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3053403

Change-Id: If8adce05a59f0e473f424f855c0cc6315cacd35d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-22 23:29:03 +00:00
Treehugger Robot
b0a4e48c15 Merge "PackageFile for permission/*.xml for sdk_library" into main 2024-04-22 23:20:39 +00:00
Treehugger Robot
affbd19c64 Merge "Include stubs type in metalava.rsp filename" into main 2024-04-22 23:15:59 +00:00
Paul Duffin
0a71d7329d Use new --api-lint-previous-api
Bug: 327019023
Test: ./gradlew
Change-Id: Ief4d7380e7242dff4e82df96778af17d56c4fe82
2024-04-22 23:48:19 +01:00
Jihoon Kang
421c1cd796 Include stubs type in metalava.rsp filename
Currently, metalava.rsp filepath for both the everything and the
exportable stubs type are identical, which may lead to incremental build
issues. This change resolves such issue by including the stubs type in
the metalava.rsp filename.

These files cannot be modified as ".../everything/metalava.rsp" and
".../exportable/metalava.rsp" as `FlagWithRspFileInputList(...)`
enforces the rsp filepath to be outside of the outdir, which is
".../everything/" and ".../exportable/", respectively. Thus, this change
continues to generate the rsp file to be generated in the module outdir,
but modifies the name of the rsp files as "everything.metalava.rsp" and
"exportable.metalava.rsp".

This change also simplifies the parameters in metalavaCmd(...) for the
simplicity of the method parameters.

Test: m nothing and inspect output for the everything and the exportable stubs
Bug: 336360490
Change-Id: Ifd4e89ef69808e79ea720199677585f0217f7c1c
2024-04-22 21:29:05 +00:00
Jeongik Cha
00e0991f70 PackageFile for permission/*.xml for sdk_library
Bug: 333311683
Test: build android.bp system image and then check if there is
permission xml file for sdk_library

Change-Id: If5ac1975a7db10d85a1b11c1cd666051e3da546e
2024-04-23 05:49:44 +09:00
Colin Cross
19cdb7acf0 Merge "Convert apex mutator to a TransitionMutator" into main am: 757e88a9df am: c955bda138
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3042819

Change-Id: I6a986963f5e18b21668670fe600302d2d6af9447
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-22 19:25:22 +00:00
Colin Cross
757e88a9df Merge "Convert apex mutator to a TransitionMutator" into main 2024-04-22 18:32:22 +00:00
Rico Wind
7152e82a42 Enable non final ids for non BusyBox builds
Non final ids is a prerequisite for using optimized shrinking and
it will soon be a hard R8 error if you pass final ids in R classes
with optimized shrinking enabled.

Bug: 325905703
Test: SystemUIGo with optimized shrinking
Change-Id: I364edc5a0b22be7b4d737c2aa470a84704d05283
2024-04-22 11:24:36 +00:00
Sorin Basca
dd6e2e10af Merge "Add Java 21 as a known version" into main am: db70a80cc7 am: 0dbffbcee4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3048694

Change-Id: I618b6feaa7feae526e85cf8e0db516a51db576a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-22 07:43:43 +00:00
Sorin Basca
db70a80cc7 Merge "Add Java 21 as a known version" into main 2024-04-22 07:08:02 +00:00
Treehugger Robot
18a42af5ef Merge "Support passing multiple last api files to metalava in droidstubs" into main am: 40639d7d7a am: ad4a90cd2b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2955008

Change-Id: Ie0b965487cded95dfac7cefcbb8757d4919f424b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-19 20:37:55 +00:00
Treehugger Robot
40639d7d7a Merge "Support passing multiple last api files to metalava in droidstubs" into main 2024-04-19 20:01:32 +00:00
Spandan Das
8364694ad6 Merge "Drop use_source_config_var from prebuilt selection" into main am: 2182c08f3e am: bf3c77cfc5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3048855

Change-Id: Ide20f4d36d90791ec7c137f51f03ab8b72ee80ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-19 19:35:14 +00:00
Jihoon Kang
5623e5425a Support passing multiple last api files to metalava in droidstubs
This change supports passing multiple last api files to metalava,
instead of emitting an error when multiple files are passed as inputs.

The last api file providing modules are filegroups or genrule modules
that output exactly one output file. This change modifies that behavior
so that the filegroups can output multiple api files.

The last api file providing modules are (mostly) generated from the
`prebuilt_apis` sdk module. However, these modules only provide a single
api scope txt files (e.g. system api scope last api file filegroup
would only provide last system api file, not system + public). This
change modifies `prebuilt_apis` by generating "combine" filegroup
modules, that include api files of the subset api scopes as well.

The ordering of the files are handled when generating the combined api
filegroup modules, and droidstubs module does not check whether the
passed api files are in order from the narrowest api scope to the widest
api scope.

Submission of this change will be done once metalava fully supports
handling multiple api files input for api lint and nullness migration.

Test: m nothing
Bug: 321827591
Change-Id: I2066e7ceb7ee7c6d0fd87cd43bfd08db906d4b8f
2024-04-19 10:56:32 +01:00
Sorin Basca
1fe2cc883f Add Java 21 as a known version
Bug: 335612268
Test: Set java_version to 21 in core-all && m
Change-Id: Ie2093187cec75949ae3bb4903edfb6f62aa31f6e
2024-04-19 10:45:55 +01:00
Spandan Das
7e674e69ef Drop use_source_config_var from prebuilt selection
This CL makes this property a no-op from the perspective of prebuilt
selection. The primary user of this was mainline modules, but they have
now switched to RELEASE_APEX_CONTRIBUTIONS_* for prebuilt selection,
both for internal `main` development and in partner drops.

Test: in internal, lunch cf_x86_64_phone-next-userdebug; m nothing; and
verified there was a path to the prebuilt bt apex

Test: in partner workspace, lunch gsi_partner_arm-ap31-userdebug; m
nothing; and verified that there was a path to the prebuilt adservices apex

Bug: 308188211
Change-Id: I124a6dada5c20aca4bdebf70dcbe5bbec28cefbe
2024-04-18 22:35:42 +00:00
Colin Cross
7c035064db Convert apex mutator to a TransitionMutator
Replace the apex mutator with a TransitionMutator.  Requires moving the
base.apexInfo value into a provider so that it is still present for the
Mutate pass.

Test: go test ./...
Test: no change to out/soong/build-${TARGET_PRODUCT}.ninja
Change-Id: I1c898eaf30b4021f0f96f439cc0b3b3173710fc7
2024-04-18 15:08:43 -07:00
Treehugger Robot
5ea835bd85 Merge "Allow dexpreopt of source sdklib in prebuilt apex builds" into main am: 17b9a5b8b4 am: 5f7e0106d7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3045742

Change-Id: Icfa72baf95d3c17830213afe70853bb15b44a6c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-18 02:05:49 +00:00
Treehugger Robot
17b9a5b8b4 Merge "Allow dexpreopt of source sdklib in prebuilt apex builds" into main 2024-04-18 01:25:15 +00:00
Spandan Das
5ae65ee6e0 Allow dexpreopt of source sdklib in prebuilt apex builds
aosp/2984037 disabled dexperopt of the source apex system server jars
when prebuilts are selected. This was done to prevent duplicate
installation and dex2oat deps.

AOSP art has some additional variants like com.android.art.debug. In
source builds, this apex should contain service-art.jar and
service-art.jar.prof (a dexpeopt artifact). We have a test to check this
(`art_apex_test.py`). If we disable dexpreopt of source sdlib when
prebuilts are selected, this test needs to be disabled. This is the
behavior at ToT.

This CL changes the behavior to enable running this test even when
com.google.android.art prebuilt is active in a specific release
configuraiton. To prevent collisions that prompted aosp/2984037, this CL
special-cases the installation and dex2oat rules instead of disabling
dexpreopt of the source sdklib altogether.

b/331665856 tracks the principled solution to prevent duplicate
dexpreopt rules.

Implementation:
Add a new copyApexSystemServerJarDex arg to GenerateDexpreoptRule API.
If true, the dexjar file will be copied to
out/soong/system_server_jars/. For soong modules, the value of this will
be the inverse of disableSourceApexVariant. Since none of the apex
system server jars are in make, this will be a noop in dexpreopt_gen

Bug: 331665856
Test: modified trunk_staging.scl locally to select
art.google.contributions.prebuilt; mmma art; (with the sibling CL in
topic)

Change-Id: Idb59e424f83d126cdc8b1671dde358745979bd8d
2024-04-17 23:15:20 +00:00
Treehugger Robot
31448fc5f8 Merge "Remove extractEncodedDexJarsFromModules" into main am: 7bfe1377af am: 15feb2c9b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3047153

Change-Id: Ic9e8de180d96ca454193a12f8d256d1e6dd41939
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 21:22:00 +00:00
Treehugger Robot
7bfe1377af Merge "Remove extractEncodedDexJarsFromModules" into main 2024-04-17 20:46:34 +00:00
Jihoon Kang
6d6d067c37 Remove extractEncodedDexJarsFromModules
The usages of this function have been removed with
https://r.android.com/2816477 and https://r.android.com/2816578, and
this function is currently unused.

Test: Presubmits
Change-Id: Ic1ae71ade16b930b777fa251febc4d071c0dd65e
2024-04-17 18:19:14 +00:00
Treehugger Robot
9a8255f48e Merge changes from topic "cherrypicker-L27000030003160683:N90900030051335582" into main
* changes:
  Propagate transitive missing optional_uses_libs.
  Refactor the contruction of the manifest check inputs.
2024-04-16 13:35:54 +00:00
Jiakai Zhang
369370818f Propagate transitive missing optional_uses_libs.
Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
Change-Id: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
2024-04-15 12:16:21 +00:00
Jiakai Zhang
f98da19a07 Refactor the contruction of the manifest check inputs.
This is a no-op change for a majority of cases.

Before this change, the contruction of the manifest check inputs is
confusing. It mutates uses_libs properties in place just for the
manifest check, by replacing module names with library names for
direct dependencies and merging library names from CLC for both direct
denpendencies and transitive denpendencies, and then constructs manifest
check inputs from those mutated uses_libs properties. This is
error-prone and leads to insistency: the goal is to check that the CLC
matches the manifest, but the inputs to the check don't reflect the CLC.

After this change, we no longer mutate uses_libs properties in place.
Instead, we maintain a separate list of missing denpendencies, and then
construct manifest check inputs directly from the CLC for all existing
libraries, no matter they are direct or transtive, and from the separate
list of missing libraries. This change makes the logic more
consistent and straightforward, and it also allows us to easily do the
next change, which is to propagate transtive missing denpendencies.

In fact, this change revealed several bugs around library optionality
and order in CLC construction, and fixed them.

Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: I0de82e76c47995b54aba9efd41538d950256a95f
Change-Id: I0de82e76c47995b54aba9efd41538d950256a95f
2024-04-15 11:15:41 +00:00
Jiakai Zhang
d7e3534def Merge "Propagate transitive missing optional_uses_libs." into main 2024-04-15 10:02:21 +00:00
Ronald Braunstein
c6b3eab537 Merge "Add "test-only" flag for java modules" into main am: 720146b2f2 am: d38b96ed96
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3040036

Change-Id: I4a9def65ea494698d62011db1aabee54207a9e64
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-12 23:54:48 +00:00
Ronald Braunstein
720146b2f2 Merge "Add "test-only" flag for java modules" into main 2024-04-12 23:13:51 +00:00
Treehugger Robot
313714ce08 Merge "Add support for transitive resources to android_library_import" into main am: c5c54803e6 am: 7c1c3de7be
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3040832

Change-Id: Iaa438072ba7c8e1aa57df1dbd5fbb8b6dd1f6363
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-12 22:39:51 +00:00
Treehugger Robot
c5c54803e6 Merge "Add support for transitive resources to android_library_import" into main 2024-04-12 22:04:27 +00:00
Colin Cross
607bbd64dd Add support for transitive resources to android_library_import
Collect and propagate resource jars from static dependencies of
android_library_import modules.

Bug: 288358614
Test: TestAndroidLibraryOutputFilesRel
Change-Id: I076f3c8e4ce42f71a52b612b77eb0265fa1e974c
2024-04-12 13:45:35 -07:00
Ronald Braunstein
cdc66f4268 Add "test-only" flag for java modules
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for java modules.

We let users set "test-only" on java_library, but not on other modules
where the module kind is implicitly test-only, like java_test.
The implementation, not the user decides it is test-only.
We also exclude it from java_defaults.

	% gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind'
	+--------------------------+----------+
	|        teams.kind        | count(*) |
	+--------------------------+----------+
	| android_test             |     1382 |
	| android_test_helper_app  |     1680 |
	| java_fuzz                |        5 |
	| java_test                |      774 |
	| java_test_helper_library |       29 |
	+--------------------------+----------+

	 % gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true and teams.kind not like "%cc_%" group by teams.kind'
	+--------------+----------+
	|  teams.kind  | count(*) |
	+--------------+----------+
	| android_test |     1382 |
	| java_fuzz    |        5 |
	| java_test    |      774 |
	+--------------+----------+

Test: m nothing --no-skip-soong-tests
Test: go test ./java
Test: m all_teams

Bug: b/327280661
Change-Id: I9c3ad947dc3d68d6427abada27449526d69daa6b
2024-04-12 11:42:10 -07:00
Jiakai Zhang
d2ce58d924 Merge "Refactor the contruction of the manifest check inputs." into main 2024-04-12 06:50:15 +00:00
Treehugger Robot
b1d555a77f Merge "Strip relative paths from java_import output files" into main am: 80214e550e am: 5b50be5aa9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3038158

Change-Id: I041eef99f5a14b0836a4f9d12dc6ee75d7d8d390
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-12 01:54:44 +00:00
Treehugger Robot
80214e550e Merge "Strip relative paths from java_import output files" into main 2024-04-12 01:22:10 +00:00
Colin Cross
5e87f349b8 Strip relative paths from java_import output files
androidx.annotation_annotation is used as a test data file, and
converting it from a java_library to a java_library_import causes
the relative path used in the test data path to change. Clear the
relative path in java_import the same way that other java based
modules do.

Bug: 288358614
Test: TestJavaLibraryOutputFileRel
Change-Id: I1f494110da32e916043ca94ac6ebeeafccc06f9a
2024-04-11 16:51:21 -07:00
Treehugger Robot
b71375ac31 Merge "Make app.go not executable" into main am: 0565fdc3cb am: 3ebc99c605
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3039820

Change-Id: I07d6bb4bcc0c2a9f72b74ff34bfb8060e4c0a1a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-11 23:04:55 +00:00
Treehugger Robot
0565fdc3cb Merge "Make app.go not executable" into main 2024-04-11 22:26:09 +00:00
Treehugger Robot
60d2dec9fc Merge "java_sdk_library: Use WriteFileRule for writing permissions.xml" into main am: 1065ed8fbd am: 5b5557773c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3036694

Change-Id: Ia586005e57a8556a200492273814cc07ad958264
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-11 21:35:39 +00:00
Cole Faust
7a51454f5b Make app.go not executable
Test: Presubmits
Change-Id: I983e58980cab2aa58797714c216851a1a7eb7f73
2024-04-11 14:13:20 -07:00
Treehugger Robot
1065ed8fbd Merge "java_sdk_library: Use WriteFileRule for writing permissions.xml" into main 2024-04-11 20:55:30 +00:00
Jihoon Kang
f4b835ccd9 Merge "Collect aconfig_declarations of the dependent java_aconfig_library modules" into main am: 033ffb9533 am: 1628b82c6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3001319

Change-Id: I81e9d102c17bb5a1caf4400fc9d9513eb2be5c02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-11 18:03:02 +00:00
Spandan Das
5bcf17db15 Merge "Revert "Add the implicit deps of javacRE"" into main am: d5b05655bb am: 0c5dee6f99
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3037722

Change-Id: Ifb4ee9667fd162cd4fbf2ab905b47026ccac2e88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-11 18:02:12 +00:00