3675 Commits

Author SHA1 Message Date
Spandan Das
bcc2ef06e7 Improve docs for Deapexer modules
The provider does not get bubbled up, so remove this misleading comment.

Test: doc change
Change-Id: Ife110aa75c8910042cf9c6e358a44d1a5cf4f5c3
2024-08-14 18:55:59 +00:00
Kiyoung Kim
faf6af31cd Introduce vintf_fragment module type
Introduce a new vintf_fragment module type which handles vintf_fragment
files within Soong. This will help process to move vintf_fragment
handling logic from KATI to Soong. This change also introduces
vintf_fragment_modules property to mark dependency with vintf_fragment
modules.

Bug: 322089980
Test: m nothing --no-skip-soong-tests passed
Change-Id: I49607f42aeee3ded0ba7b078b903dc35f5d61637
2024-08-14 10:34:41 +09:00
Yu Liu
ac93739762 Merge "Merge SingletonProviderContext with OtherModuleProviderContext" into main am: 246b43049c am: 73282e8129
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3216676

Change-Id: Ic5fa82e4179f922e35479e527a392db141a973c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-13 16:38:05 +00:00
Yu Liu
663e4508dc Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
2024-08-12 22:50:19 +00:00
Colin Cross
bb5c9f5d82 Merge changes If313580b,I68d50d68 into main am: 08b6061539 am: 6bdec0cbe6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214342

Change-Id: Ie9dd3fc7d9d901150257108b92d8ce4079796b44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-12 18:46:24 +00:00
Colin Cross
a66b4630f6 Add PrepareForTestWithBuildFlag
Add a helper function that creates a test fixture preparer that
sets a build flag, and use it everywhere that was setting build flags
manually.

Test: all soong tests
Flag: EXEMPT refactor
Change-Id: I68d50d68787a30d091f0827e8caa51f5c5a762ef
2024-08-09 16:47:45 -07:00
Jooyung Han
8c38760046 Merge "apex: rm $out before decompressing an apex." into main am: f826c99ec2 am: c8a2120f84
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3213175

Change-Id: I3a715d30b3d332728f08b805c03715df8f0b3687
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-09 02:27:14 +00:00
Jooyung Han
8fa6116aca apex: rm $out before decompressing an apex.
Otherwise, incremental build fails with "already exists".

Bug: 357916000
Test: incremental build with PRODUCT_COMPRESSED_APEX=false and prebuilt
  compressed APEXes
Change-Id: If2a0be735e3710afd1d40b16b43608028eb95c5a
2024-08-08 10:45:48 +09:00
Treehugger Robot
f99ac31e34 Merge "Revert "Revert "Enable from-text stub generation in non-sdk java..."" into main am: 4f18cfdd7d am: 5d2439b3b1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3205865

Change-Id: I163753b63bc5b3b495d70ea46a15ebb5f58d2c68
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 19:25:01 +00:00
Treehugger Robot
4f18cfdd7d Merge "Revert "Revert "Enable from-text stub generation in non-sdk java..."" into main 2024-08-06 18:50:04 +00:00
Treehugger Robot
7bc808665e Merge "Hide unflagged mainline prebuilts with missing source." into main am: 9b10ca4711 am: fc413ce622
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3203370

Change-Id: I580da7d09016c230e9375667dcf3a7faa87dc7f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:36:09 +00:00
Jihoon Kang
377802211b Merge "Revert "Enable from-text stub generation in non-sdk java_sdk_library"" into main am: f6d9965cc5 am: ad5e953a7d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3207397

Change-Id: I411dc190da40073de7d794de9ad7ef8fd5da9ed3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:35:42 +00:00
Treehugger Robot
043401d91e Merge "Enable from-text stub generation in non-sdk java_sdk_library" into main am: 99417ba9ea am: 696cea31d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2983176

Change-Id: I298312e534e440f607bff40cc9ceae788edba9e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:33:22 +00:00
Jihoon Kang
b0f4c0239d Revert "Revert "Enable from-text stub generation in non-sdk java..."
Revert submission 3207397-revert-2982300-java_api_library_non_sdk-FIKZOSARQI

Reason for revert: Post submit build breakage culprit fixed

Reverted changes: /q/submissionid:3207397-revert-2982300-java_api_library_non_sdk-FIKZOSARQI

Change-Id: Ic79b7fd074f02febba94183cb1479874efe044b5
2024-08-06 00:15:25 +00:00
Treehugger Robot
9b10ca4711 Merge "Hide unflagged mainline prebuilts with missing source." into main 2024-08-05 23:10:53 +00:00
Jihoon Kang
f6d9965cc5 Merge "Revert "Enable from-text stub generation in non-sdk java_sdk_library"" into main 2024-08-05 20:51:31 +00:00
Liana Kazanova
a574cd28a8 Revert "Enable from-text stub generation in non-sdk java_sdk_library"
Revert submission 2982300-java_api_library_non_sdk

Reason for revert: DroidMonitor: Potential culprit for b/357648959 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:2982300-java_api_library_non_sdk

Change-Id: I5ef7afd9ec3e10ea99f82d02172843ad9b2cfda9
2024-08-05 19:45:03 +00:00
Spandan Das
85bd4625ed Hide unflagged mainline prebuilts with missing source.
Partner worksapces contain two versions of mainline prebuilts - BigAndroid
and Go. These two prebuilts export dexpreopt'd system server artifacts
to be installed in system image. Since the install paths are same, we
run into duplicate installation rules issue unless one of them is
hidden.

This hiding was previously done by creating a dependendency between
source aosp apex to BA and Go google prebuilts. However, this
implementaion had the unfortunate side effect on the packaging name of
the Google mainline prebuilts - the name becomes the aosp apex name.

Instead of creating the dependency to aosp apex, this CL hides all
mainline apex_set(s) if it has not been flagged using
RELEASE_APEX_CONTRIBUTIONS_*. Since there are some non mainline apex
prebuilts, apex_name will be used to determine whether the prebuilt is a
mainline module.

Test: m nothing --no-skip-soong-tests
Test: In partner workspaces, downloaded the CLs in b/355682304#comment7
Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt
verified that aosp apexes are not installed, but mainline prebuilts are
installed

Test: unset RELEASE_APEX_CONTRIBUTIONS_ADSERVICES to build from source
Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt
verified that aosp adservices is installed, and adservices prebuilt is
**not* installed.

Bug: 355682304
Change-Id: Idacb65313553bdea5c0593976694de478034229e
2024-08-05 18:25:37 +00:00
Treehugger Robot
99417ba9ea Merge "Enable from-text stub generation in non-sdk java_sdk_library" into main 2024-08-05 18:25:36 +00:00
Jooyung Han
77ef965f88 Merge "apex: respect PRODUCT_COMPRESSED_APEX for prebuilt APEXes" into main am: b42b703f53 am: de22d9608a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3201250

Change-Id: I7a27e264cffe85996836e0a3f0ccc5812ab99d53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-01 01:38:43 +00:00
Jooyung Han
26ec8484e4 apex: respect PRODUCT_COMPRESSED_APEX for prebuilt APEXes
If a prebuilt APEX is compressed, it's installed without decompression
even when PRODUCT_COMPRESSED_APEX is false.

This change decompresses the prebuilt/compressed APEX.

Bug: 356533488
Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=false m
Change-Id: Ifdde074e383837df92d172bc483bfca9a97cb6f8
2024-07-31 15:04:05 +09:00
Jihoon Kang
062eb663c5 Enable from-text stub generation in non-sdk java_sdk_library
This change allows from-text stubs to be generated for all
java_sdk_library modules, unlike how it is currently limited to the
modules that contribute to the api surfaces (i.e. the SDK).

This change accomplish this by modifying the dependency of the
from-text stubs generation, so that the sdk_library generated from-text
stubs generating java_api_library modules no longer depend on the full
api surface stubs, but generate the stubs in the module level, and
combined later to generate the full api surface stubs.

This change also removes the java_api_library modules defined in
core-libraries/Android.bp, which are passed to generate the system
modules. Given that the from-text vs from-source toggle is done within
the java_sdk_library stubs level, these modules no longer need to exist.

Implementation details:
- Allow sdk_version to be specified in java_api_library modules. For
  java_sdk_library-generated java_api_library modules, they inherit that
  of the sdk_library module. Some java_sdk_library modules that do not
  contribute to the api surface are allowed to set sdk_version to
  something other than "none" or "core".
- Implement java_api_library to implement `SdkContext`. This allows
  java_api_library to collect required deps from sdk_version (classpath,
  bootclasspath, system modules), and pass the collected jars when
  generating the stubs srcjar in metalava and compiling the stubs srcjar
  in javac.
- Remove hardcoded list of sdk_library modules that are allowed to
  genereate stubs from the api signature files, and allow from-text
  stubs generation by default. Modules that are not able to generate
  stubs from the api signature files are specified by setting the newly
  introduced `Build_from_text_stubs` property to `false`.

Test: ENABLE_HIDDENAPI_FLAGS=true m
Bug: 327507877
Change-Id: Ia35d2f3cf9fae48fc8c4bd99a84ae18d7c0e7bee
2024-07-30 22:35:06 +00:00
Treehugger Robot
21207540b8 Merge "Cleanup configurable getter usages" into main am: c6f1fe0861 am: d1fb3378ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3198402

Change-Id: Ic646cc1686db7b39f74f26badf5dc1a6b6602689
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-29 21:35:41 +00:00
Cole Faust
bf1d92ad20 Cleanup configurable getter usages
You don't have to call module.ConfigurableEvaluator(ctx) if ctx is
already a ModuleContext, you only need to do that for more restricted
contexts like SingletonContext.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I7612290d43dae7decfae283a341882d9016c98a3
2024-07-29 12:24:25 -07:00
Treehugger Robot
45be135b5c Merge "Do not rename prebuilt apexes for product packaging" into main am: 9aa84c6110 am: 0b0a99f01f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3197217

Change-Id: I67dcce15611742c000fa9a1b1d205862a28e39af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-26 21:54:17 +00:00
Treehugger Robot
9aa84c6110 Merge "Do not rename prebuilt apexes for product packaging" into main 2024-07-26 21:08:31 +00:00
Spandan Das
a8e2d6173d Do not rename prebuilt apexes for product packaging
https://r.android.com/2901309 added support for handling installation
rules for multiple prebuilts. One of the implementation details there
was to change LOCAL_MODULE name to the source apex name in the generated
.mk files.

This causes issues in partner builds where the google singed apex
com.google.android.foo gets renamed to com.android.foo in
out/soong/Android-$PRODUCT.mk. If the partner builds does not include
the aosp apex in its PRODUCT_PACAKGES, then the google signed apex gets
elided from packaging.

This CL undoes that change. After this CL, the name of the module as it
appears in Android.bp will match the LOCAL_MODULE name emitted for
product packaging.

Test: in build/soong, go test ./apex
Bug: 355682304
Change-Id: Icadbb75609174cff5326f52baf7d53e901f9f1c0
2024-07-26 19:24:27 +00:00
Treehugger Robot
a982857a81 Merge changes from topic "avf_apex_android_bp_select" into main am: 6899b7ed22 am: ccae8282a5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3189226

Change-Id: I29bb1619b0cee82af9bdfadcc7b4ecd338cebd1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-25 02:43:13 +00:00
Inseob Kim
40b64b4096 Make some apex properties configurable am: b114234f6b am: 5402171253
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3189224

Change-Id: I6087622d56958fe1b61f5492f03b6b5eeb6c65b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-25 02:43:08 +00:00
Inseob Kim
5402171253 Make some apex properties configurable am: b114234f6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3189224

Change-Id: Ic6414ae157486b4d5b9a5bc31687b2f8524122b6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-25 02:07:43 +00:00
Treehugger Robot
6899b7ed22 Merge changes from topic "avf_apex_android_bp_select" into main
* changes:
  Make more apex properties configurable
  Make genrule's srcs property configurable
  Make some apex properties configurable
  Make the vintf_fragments property configurable
  Make the defaults property configurable
2024-07-25 01:52:54 +00:00
Inseob Kim
d23e0d3244 Make more apex properties configurable
This allows using select statements with these.

* apps
* binaries
* prebuilts

Bug: 354824866
Test: m --no-skip-soong-tests
Change-Id: I8e28937d2fa6514b41bd189f56f9f584a60d2c80
2024-07-25 00:55:38 +00:00
Inseob Kim
b114234f6b Make some apex properties configurable
This allows using select statements with these.

* androidManifest
* canned_fs_config
* systemserverclasspath_fragments

Bug: 354824866
Test: m
Change-Id: I4c2182944ec14d99332f437c39a19ba0dc6b7731
2024-07-25 00:55:05 +00:00
Treehugger Robot
70944ae559 Merge "Drop module sdk MakeUninstallable special case" into main am: 9a2f01b762 am: e58421b340
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3188499

Change-Id: If776629cec033090af07a732209eb5dd3464042e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-23 17:24:30 +00:00
Spandan Das
2f68f1903a Drop module sdk MakeUninstallable special case
Platform variants of module sdk libraries were marked as uninstallable
originally in https://r.android.com/1974259. This special case is no
longer necesssary - android.MutateApexTransition will call
MakeUninstallable on the platform variant on both the source and
prebuilt soong modules when the following conditions are met
- //apex_available:platform is not listed in apex_available (explicitly
  or via the default implicit)
- the soong module is included in an apex that exists in the tree
  (listed in native_shared_libs)

Since MakeUninstallable is set by apex specific mutators, the relevant
unit test has been moved to the apex package. The Android.bp of the test
has also been extended with an apex that includes the shared library.

Test: m nothing --no-skip-soong-tests
Test: no diff in out/soong/Android-$product.mk
Test: added prebuilt_libdexfile to art's apex_contributions locally, no
diff in out/soong/Android-$product.mk

Bug: 220898484
Change-Id: I43a324882d486451bb921028853508d7ec3d76bf
2024-07-22 23:13:20 +00:00
Treehugger Robot
c156e5c955 Merge "Remove allowlist for updatable modules with current min_sdk_version" into main am: dd9b0c1be8 am: ff8b90d92e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3180441

Change-Id: Ibe54341384f6f36af3822fb8148e8a211bb0ddee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-19 17:45:27 +00:00
Treehugger Robot
dd9b0c1be8 Merge "Remove allowlist for updatable modules with current min_sdk_version" into main 2024-07-19 17:04:57 +00:00
Colin Cross
bcc87ab14e Merge changes from topic "elide_empty_variants" into main am: ea1b3b78b8 am: ec6c8ca013
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3163861

Change-Id: I28cdcce6304d242b19edba8646f827f446df00f9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-18 17:50:58 +00:00
Colin Cross
ea1b3b78b8 Merge changes from topic "elide_empty_variants" into main
* changes:
  Convert sdk mutator to TransitionMutator
  Convert link mutator to TransitionMutator
  Convert version mutator to TransitionMutator
  Convert python_version mutator to TransitionMutator
  Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
2024-07-18 17:37:38 +00:00
Colin Cross
8a49a3dd76 Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
Replace rust.LibraryMutator and rust.LibstdMutator with
TransitionMutators.

Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: Ia24a582119d39889279d7b93bac9259685153619
2024-07-17 15:50:36 -07:00
Spandan Das
32c93a3f3c Remove allowlist for updatable modules with current min_sdk_version
All existing violations have been cleaned up.

Bug: 221087384
Test: presbumits
Change-Id: Iefe318d9372d4078f21b03e0d9003609cca069ab
2024-07-17 20:31:58 +00:00
Treehugger Robot
53ad20c491 Merge "Min_sdk_version check for updatable apexes" into main am: 0adcc8c83d am: 03042b57a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3156080

Change-Id: Ic9c99a819610af549b95f9546df39ea657b052af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-16 19:45:38 +00:00
Treehugger Robot
0adcc8c83d Merge "Min_sdk_version check for updatable apexes" into main 2024-07-16 19:09:03 +00:00
Treehugger Robot
f9f708388a Merge changes I861a60e1,I01bf99fa,I9d16dfec into main am: 9678733731 am: fd440d75e5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3150116

Change-Id: I612cdbb3292da68820d7c2446fdba939112a28fc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-16 01:29:47 +00:00
Treehugger Robot
9678733731 Merge changes I861a60e1,I01bf99fa,I9d16dfec into main
* changes:
  Add util method HasIntersection(...)
  Implement InstallableModule for Java modules
  Collect container informations
2024-07-16 00:43:04 +00:00
Jihoon Kang
f86fe9a876 Implement InstallableModule for Java modules
This change enables the container information to be collected for Java
modules.

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: I01bf99fa274275a608601ad6248d577ae8f6dffc
2024-07-15 23:46:01 +00:00
Treehugger Robot
536fad002b Merge "Remove apex.use_vndk_as_stable" into main 2024-07-15 02:03:15 +00:00
Colin Cross
5e4ab3379b Add IsAddingDependency to IncomingTransitionContext am: e1a8555581 am: 4a6b31a65e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3141802

Change-Id: Ia16e9ef02996ce4d2b2a59383fd638d42b66a5d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-12 00:52:08 +00:00
Colin Cross
e1a8555581 Add IsAddingDependency to IncomingTransitionContext
Add an IsAddingDependency method to IncomingTransitionContext that
returns true if IncomingTransition is called after the transition
has already won while adding a new dependency.  This will be used
as part of the transition mutators to support an apex use case where
incoming dependencies during the initial apex mutator need to be
rewritten onto the platform variant for modules that don't support
the apex, but a later call to OtherModuleDependencyVariantExists
must not rewrite the requested apex variation onto the platform
variant.

This should be used sparingly, all uses will have to be removed in
order to support creating variants on demand.

Bug: 319288033
Test: TestIsAddingDependency
Flag: EXEMPT refactor
Change-Id: Ib8e419d35ff8f7cbff9667c1cd40d05ccfacab8b
2024-07-11 16:59:34 -07:00
Colin Cross
8cd1fa9d0a Merge "Remove test_per_src" into main am: 088123934b am: d66ec63bde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3142038

Change-Id: I0aab777c604498195d67bf8e70f338f3b373210c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-11 21:07:57 +00:00