Commit graph

7300 commits

Author SHA1 Message Date
Aditya Choudhary
07c048b875 Add test for soong/testing/test_spec. am: b7b3de8307
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2836072

Change-Id: I9d1266accf8fa098befce4d5d2924e63fef7d699
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
2afaecefef Merge "resourceshrinker: Add dexContainerExperiment flag" into main am: 3f7d0f6797
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2828314

Change-Id: I7bafad2a6640244f16bd4d5986068b2e4bda882e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-21 08:43:52 +00:00
David Srbecky
3f7d0f6797 Merge "resourceshrinker: Add dexContainerExperiment flag" into main 2023-11-21 08:30:23 +00:00
Colin Cross
1d470f3066 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: Id63655decd89ecc2a8a0319b28c1c2ae26a14de7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-20 20:21:07 +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
7110872f1e 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: I7bcb17b8ef12327f604c2043b7b262b10c8d14d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 05:43:37 +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
875f657986 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: I959ea33725b6222a3587e91a677e2efa94612caf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 22:45:42 +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
a46cd009b6 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: Id1f7261d8b8d40b058b91d7fff9eaedbf395fff8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 21:21:42 +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
188979638c 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: Ibaee3387122face18ea83b77850ef65959771d79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 11:20:30 +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
fb6abbc305 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: Ifb8a17a7dbf6f73bb727b2fce78b622cb09181a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-14 19:46:02 +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
1c9977aece Merge "Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage." into main am: 34778a9301
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2822402

Change-Id: Ib046322e1c6c6416b9e156630db46f7f8fe5c59f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-10 19:20:07 +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
26da80db09 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: I5b8b12c7e74c6342807667587d0941a0c366f222
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 02:03: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
b39cf8346f 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: I2c25896a1495fb64709dc51f4bd253ed7fc59e7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 11:28:53 +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
45114303f5 Merge "Stop suppressing the ChangedDefault error" into main am: d69b5ff1b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2818838

Change-Id: I4d668824a55df53562943c2066274cdda7c5cbaa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 10:52:19 +00:00
Anton Hansson
d69b5ff1b2 Merge "Stop suppressing the ChangedDefault error" into main 2023-11-08 10:23:42 +00:00
Anton Hansson
971881fcd8 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: Ide1642cb3cd7af65d2898fd09ae41afb3f04b0ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-07 16:30:12 +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
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
5d7eb95911 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: Iee26d5b46aa06ac473648ac7ac2f1e04a031af42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 11:36:22 +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
8a1d9b52e5 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: Ib92111a8af066ffb5ce339af8ffe49ca29093f0e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-03 12:54:11 +00:00
Michael Stokes
2e09e68e56 Merge "Revert "Use R8 for resource shrinking"" into main 2023-11-03 12:12:40 +00:00
Treehugger Robot
0bc844d4e6 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: I80c1e849ff89b747d94740590197eb8c63be597a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-03 11:43:17 +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
cb5d4a3649 Merge "Use R8 for resource shrinking" into main am: 4ea88503e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2813214

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

Change-Id: I496675d16c6d15443e191a4c80fa6ec604daf52f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-03 02:18:10 +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
2488ed09f7 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: Ic17bea5bfe5362592b96860d76e9e7f2c9c61522
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 19:24:57 +00:00