Commit Graph

8202 Commits

Author SHA1 Message Date
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
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
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
Jihoon Kang
033ffb9533 Merge "Collect aconfig_declarations of the dependent java_aconfig_library modules" into main 2024-04-11 17:37:58 +00:00
Spandan Das
d5b05655bb Merge "Revert "Add the implicit deps of javacRE"" into main 2024-04-11 16:53:12 +00:00
Anna Bauza
d0476e4652 Revert "Add the implicit deps of javacRE"
This reverts commit eaa475107d.

Reason for revert: This cl broke AOSP build, read more b/333846153

Change-Id: I5538a3c78617d7c2db98a11b60cb61269dcec8d3
2024-04-11 09:58:46 +00:00
Spandan Das
6936459dbb Merge "Add the implicit deps of javacRE" into main am: fc4d366e38 am: 0dce877166
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3034456

Change-Id: If2deccc7f2dd1f1e2a24a5f5cda50305d1806c97
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-10 20:31:53 +00:00
Spandan Das
fc4d366e38 Merge "Add the implicit deps of javacRE" into main 2024-04-10 20:20:43 +00:00
Paul Duffin
1816cde8ce java_sdk_library: Use WriteFileRule for writing permissions.xml
Use the `WriteFileRule` to write the permissions file for shared
libraries instead of generating a custom bash rule.

Test: TH
Change-Id: I904cf0742bfec46ed45ec7801bb9bd3dc3047185
2024-04-10 13:21:28 +01:00
Spandan Das
eaa475107d Add the implicit deps of javacRE
This includes
1. the prebuilt javac binary
2. the input .java files
3. the jars that are placed on the classpath during javac

(2) is passed via ${out}.rsp. This rsp file gets populated with the
input java files

For (3), this CL creates a new intermediate file whose content is
comma separated jars available on the classpath (this is the format
expected by rewrapper). This file is then registered in RSPFiles of
javacRE command, so that it gets passed to the rewrapper cmd as
`--input_list_paths`

(rspfiles are necesary for modules like framework-minus-apex to avoid
exceeding cmd line limits)

Bug: 308687455
Test: m framework-minus-apex; # verified that the relevant files are
added as `--inputs` of javac

Change-Id: I2ab9277fc394eb00454ef503c78a9f3451e596ac
2024-04-10 00:37:31 +00:00
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
Nikolay Elenkov
c8170926f6 Merge "Add secretkeeper-v1-java to platform APIs" into main am: f28b5697b8 am: 196729ffda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3003166

Change-Id: I6ed203fab98537ae18c51c9def19434acdbf20db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-09 02:20:53 +00:00
Nikolay Elenkov
f28b5697b8 Merge "Add secretkeeper-v1-java to platform APIs" into main 2024-04-09 01:59:35 +00:00
Treehugger Robot
926580047b Merge "Return the header jar of the implementation library in SdkHeaderJars()" into main am: 133a6d9e6f am: f68bf7d95b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3026823

Change-Id: I9943c80d7c530fa86ab8d2e81dfd64cb7ce5fdfa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-05 04:13:51 +00:00
Treehugger Robot
133a6d9e6f Merge "Return the header jar of the implementation library in SdkHeaderJars()" into main 2024-04-05 03:23:34 +00:00
Jihoon Kang
8479dea802 Return the header jar of the implementation library in SdkHeaderJars()
As part of the process to remove the compilation action in the top level
java sdk library, this change modifies SdkHeaderJars(...) (i.e. the
"magic") to return the header jar of the implementation library instead
of the header jar of the top level java sdk library when the
implementation jar is returned from the "magic".

This change also removes `SdkImplementationJars()` from the
SdkLibraryDependency interface, as it is not currently used anywhere
else.

Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: Icc00af4b1485dc2b1b0981a3e56758d0306dea69
2024-04-05 00:37:37 +00:00
Jiakai Zhang
22154d8c3e 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.
Change-Id: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
2024-04-04 13:10:28 +01:00
Jiakai Zhang
3ef7283735 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.
Change-Id: I0de82e76c47995b54aba9efd41538d950256a95f
2024-04-04 13:10:26 +01:00
Jihoon Kang
ead7fd2ec4 Merge "Add API compatilibility flags to the exportable stubs" into main am: 32e1b930e9 am: 970a886318
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3018345

Change-Id: I1f4b8b9caf0f0f9916bf9fc720f5f75b9bf9a9ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-03 16:10:32 +00:00
Jihoon Kang
32e1b930e9 Merge "Add API compatilibility flags to the exportable stubs" into main 2024-04-03 15:34:43 +00:00
Treehugger Robot
b861dc6489 Merge "Strip relative paths from android_library_import output files" into main am: eabd1ef484 am: b6be0f2d91
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3023204

Change-Id: Ide5e5eb99072c8ee31373a9d6d63bd721c3eda93
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-02 21:46:47 +00:00
Treehugger Robot
eabd1ef484 Merge "Strip relative paths from android_library_import output files" into main 2024-04-02 21:01:45 +00:00
Colin Cross
28ac2ffc80 Strip relative paths from android_library_import output files
androidx.annotation_annotation is used as a test data file, and
converting it from an android_library to an android_library_import
causes the relative path used in the test data path to change.
Clear the relative path in android_library_import the same way that
android_library and other java based modules do.

Also change the name of classes-combined.jar to the name of the
module so that the output file has the right name if there are no
static dependences that require running the merge_zips step.

Bug: 288358614
Test: TestAndroidLibraryOutputFileRel
Change-Id: I28210aa370a742d789102ff71db3685ca744878f
2024-04-02 12:21:34 -07:00