platform_build_soong/dexpreopt/dexpreopt_gen
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
..
Android.bp
dexpreopt_gen.go Allow dexpreopt of source sdklib in prebuilt apex builds 2024-04-17 23:15:20 +00:00