Commit Graph

6943 Commits

Author SHA1 Message Date
Colin Cross
e699b48df5 Merge changes Ied0a6cfe,I8c025efe into main am: adb892c539 am: d4875a4ae6 am: 4bc82d4f82 am: 52b380f33a am: 41fe9dc4fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2658796

Change-Id: I935488792818808bc80b143adaefd958fd1ee2c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 22:14:29 +00:00
Alix Espino
53a9c4fddd Merge changes from topics "errProne_bp2build_manually_enabled", "error_prone_config" into main am: 2a779ea829 am: 77a01c4809 am: 87dd2019a0 am: dff03221fa am: aa3cf2cba9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2631710

Change-Id: I813148bfb7f85aaa52e0fc29a0ac1b0892091387
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 21:47:18 +00:00
Colin Cross
adb892c539 Merge changes Ied0a6cfe,I8c025efe into main
* changes:
  Reland: Use depsets for transitive manifests and assets
  Add test for manifest merger
2023-07-17 16:30:55 +00:00
Alix Espino
2a779ea829 Merge changes from topics "errProne_bp2build_manually_enabled", "error_prone_config" into main
* changes:
  Bp2build for errorprone modules that manually enabled/disabled it
  Make errorprone a configurable attribute for bazel conversion
2023-07-17 13:54:50 +00:00
Colin Cross
cb49a6f8fb Merge "Revert "Use depsets for transitive manifests and assets"" into main am: 0a30ce7c4b am: 20d572b050 am: e5dcad264d am: 9addd4b924 am: a90456ae99
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2658795

Change-Id: Ice11213c12da0d79b897c9a38234f90aeb91c436
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 20:39:16 +00:00
Colin Cross
ab8d138d42 Reland: Use depsets for transitive manifests and assets
Instead of rolling assets and manifests up through each static lib,
provide them as a DepSet.  This will help with the next patch, which
needs to pass all the transitive manifests and R.txt files together.

This relands Id8b3aa2bed3771e82ab6bde192c9b43baa38b54c with a fix
to include additional manifests from dependencies in the final
manifest merger.

Test: app_test.go
Test: TestManifestMerger
Change-Id: Ied0a6cfee2f18e87188db145b9411d4a903ab6c9
2023-07-14 11:26:43 -07:00
Colin Cross
02bccdf37c Add test for manifest merger
Add a test for the manifest merger command line that would have prevented
b/291252863.

Bug: 291252863
Test: TestManifestMerger
Change-Id: I8c025efe7ccb06ad97b405e2927a4df07f9d3f27
2023-07-14 11:24:54 -07:00
Jiakai Zhang
176717de29 Merge changes from topics "art-boot-image-jars", "configured-jar-location-overrides" into main am: a1140990a1 am: 21abd9bd8e am: b3cf567244 am: f22029ba51 am: 39164f8382
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2655305

Change-Id: Ifd49ba082944fb9ae1cf766bf10136c95af98f28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 16:51:54 +00:00
Jiakai Zhang
b7dc3b6205 Add a Make variable that overrides configured jar locations. am: 4d90da29a8 am: a701f676d9 am: 47ee73173c am: b905734713 am: d93f271a59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2655304

Change-Id: I1938b5d076d11f1287cb465ca2bf6d7bcd19de8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 16:51:50 +00:00
Jiakai Zhang
ec0d43e0c9 Refactor dexpreopt for boot jars to make it flexible to config changes. am: cb13b5d1bd am: 0c03078eb1 am: d69968ad43 am: 670f82e021 am: 42aa81913e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2652081

Change-Id: Ib9133386f110552905db2cedf01a03045245c454
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 16:51:44 +00:00
Colin Cross
0a30ce7c4b Merge "Revert "Use depsets for transitive manifests and assets"" into main 2023-07-14 16:10:31 +00:00
Colin Cross
d8c711f884 Revert "Use depsets for transitive manifests and assets"
This reverts commit 4c90f99cb3.

Reason for revert: b/291252863

Change-Id: I646b039a305a1297167e0c56b0bce0f541da260d
2023-07-14 15:52:41 +00:00
Jiakai Zhang
a701f676d9 Add a Make variable that overrides configured jar locations. am: 4d90da29a8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2655304

Change-Id: If54785cc69a8fd40a7022342c0a726a0212a0686
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 12:26:06 +00:00
Jiakai Zhang
0c03078eb1 Refactor dexpreopt for boot jars to make it flexible to config changes. am: cb13b5d1bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2652081

Change-Id: I08692cbb4fa9bb813b3b8bfef98999567f87da9c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 12:26:03 +00:00
Jiakai Zhang
a1140990a1 Merge changes from topics "art-boot-image-jars", "configured-jar-location-overrides" into main
* changes:
  Add a Make variable to determine ART boot image jars for testing.
  Add a Make variable that overrides configured jar locations.
  Refactor dexpreopt for boot jars to make it flexible to config changes.
2023-07-14 11:47:59 +00:00
Jiakai Zhang
4d90da29a8 Add a Make variable that overrides configured jar locations.
We had hardcoded logic to override "framework-minus-apex", but we need
to override more jars, so this CL adds a general solution for this.

Bug: 290583827
Test: m nothing
Change-Id: I211ebda7aa2803886ab6e6d081d26327665e49a6
2023-07-14 12:13:30 +01:00
Jiakai Zhang
556bdf8e96 Add a Make variable to determine ART boot image jars for testing.
Bug: 290583827
Test: m nothing
Change-Id: I6eb0c83dd14682905ebaf3af55171856300eb2e3
2023-07-14 12:13:30 +01:00
Jiakai Zhang
cb13b5d1bd Refactor dexpreopt for boot jars to make it flexible to config changes.
In the past, dexpreopt for boot jars was very inflexible, and it was
incredibly hard to make a change that is as simple as adding a jar to a
boot image. Boot image generation was handled by
"platform_bootclasspath" and "bootclasspath_fragment" separately. This
caused not only code duplication but also the inflexiblity as such a
design did not fit today's use cases, where a boot image may take jars
from multiple mainline modules and the platform, and a mainline module
can contribute to multiple boot images. The design casued a huge
maintenance burden as any change to the boot image cost multi-week
efforts.

In recent years, efforts have been made to improve this a bit by a bit.
This change is another step towards making dexpreopt reasonable.

After this change, all boot images are generated by "dex_bootjars",
which is in build/soong and is therefore available on both the full
source tree and the thin manifest (master-art). The change decouples
profile generation/extraction from boot image generation. Profiles for
mainline modules are still handled by "bootclasspath_fragment"
because they need to be packed into APEXes when building mainline
modules and extracted from APEXes whem building the system image from
prebuilt modules. Boot images are not handled by
"bootclasspath_fragment" anymore.

Bug: 290583827
Test: m (all existing tests are still passing)
Test: Manually checked that the boot images are exactly the same as
  before.
Change-Id: Ib5a5f401bee334ffcab5c26618e0c8888b84575a
2023-07-14 12:13:28 +01:00
Colin Cross
c7b0295c62 Merge "Use depsets for transitive manifests and assets" into main am: 654f176379 am: b54cec3cb9 am: 44891a09ac am: 5bf41f6f96 am: 0b6b095c7f am: 3b4b912b39
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2633850

Change-Id: Ie77c6c6b2d8b6bfa000628fa8e366ef5dd2a8b7d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 00:30:27 +00:00
Vadim Spivak
5515445046 Merge "AIDEGen: Collect apt generated sources" into main am: 7a2e48bd36 am: 0f9737719e am: 8303ac5f5f am: c38550c945 am: 999465e04d am: 3003051bf2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2620724

Change-Id: Ia680452efdb993626aec64f344d74e721c74368a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 00:30:15 +00:00
Treehugger Robot
f7cfc09936 Merge "Remove metalava --no-banner argument" into main am: 105005bfd4 am: 670694a788 am: 2fe4a979c3 am: 09f18e36d9 am: cdfe019437 am: 2617ec1e3d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2655301

Change-Id: I92a49a5014448b6ef2a0de44c5bd7117378e7302
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-13 21:46:34 +00:00
Alix
b1e5c6a69a Bp2build for errorprone modules that manually enabled/disabled it
Test: go test ./bp2build
Change-Id: Ie60c0959ee9ae8ce86c11a8e85a0bc7592f63df8
2023-07-13 15:50:18 +00:00
Colin Cross
654f176379 Merge "Use depsets for transitive manifests and assets" into main 2023-07-12 21:49:13 +00:00
Vadim Spivak
7a2e48bd36 Merge "AIDEGen: Collect apt generated sources" into main 2023-07-12 21:33:59 +00:00
Vadim Spivak
3c496f00fa AIDEGen: Collect apt generated sources
The Java compiler may generate sources when processing annotations.
These sources are currently not included in the IDE project model, which
results in unresolved symbols when using Hilt and other annotation
processors. These sources are not passed to the Java compiler for
compilation, so they cannot be handled like other Java module sources.

This change archives the generated sources and appends them to the
existing srcjar list in module_bp_java_deps.json.

Test: go test .
Test: Verified that module_bp_java_deps.json contained srcjar entry
Test:   with path/to/android_common/javac/anno.srcjar.
Test: Verified that IntelliJ can resolve generated symbols after
Test:   invoking aidegen.
Change-Id: I6a3011f9140fd25f785178baee0cd6074ad94600
2023-07-12 17:34:39 +00:00
Treehugger Robot
105005bfd4 Merge "Remove metalava --no-banner argument" into main 2023-07-12 17:08:42 +00:00
Mårten Kongstad
bd2624442b Remove metalava --no-banner argument
metalava no longer prints an ASCII banner, and has removed its
--no-banner argument. Update all call sites accordingly.

Test: presubmit
Bug: 286023667
Change-Id: I61cf5f1125dfbd93496e6a59eb1ea62886b32046
2023-07-12 14:07:01 +02:00
Jiakai Zhang
1b7fe31831 Merge changes I0918f2fa,I3fc6ff91,I7adc97cb,I674a5fa1,I22c45cbf into main am: b898c112a2 am: 12e3b8adcc am: 2c4e719839 am: eb17813c98 am: 2730d59870 am: 6b92d74d25
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2652086

Change-Id: I95939a8358ca178fff7562dabbe6d8038adcbe22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-12 00:52:25 +00:00
Colin Cross
fa268b116e Merge "Add tests for code that will be affected by resource processor feature" into main am: 120b55a7ca am: 27da704772 am: 9740d8fe41 am: 9332ab33f7 am: 69f550b18a am: 587538e1b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2649208

Change-Id: Id615d02da5e0caca82cce8ade3d9cd322bc02219
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-12 00:50:59 +00:00
Jiakai Zhang
b898c112a2 Merge changes I0918f2fa,I3fc6ff91,I7adc97cb,I674a5fa1,I22c45cbf into main
* changes:
  Change the profile path on host.
  Extract duplicate code to common helper functions.
  Fix dumpOatRules.
  Remove Modules() from BootclasspathFragmentApexContentInfo.
  Fix some tests for dexpreopt and remove unnecessary tests.
2023-07-11 20:59:07 +00:00
Colin Cross
120b55a7ca Merge "Add tests for code that will be affected by resource processor feature" into main 2023-07-11 20:17:05 +00:00
Romain Jobredeaux
373a2eeef6 Merge "Support target and max sdk version in app bp2build." into main am: aa634fdbdb am: 5484ae074f am: 4e4274f597 am: 9dd8dc623f am: 47af21b8bd am: a76542f3ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2650657

Change-Id: Ibafdbc461d5c172a2a32766d08808b3d1f637fcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 17:49:10 +00:00
Jiakai Zhang
3444e561dc Change the profile path on host.
This is to decouple profile generation from image configs. A boot image
profile is either for a mainline module or for the platform, which is
orthogonal to boot images.

Bug: 290583827
Test: m nothing
Change-Id: I0918f2fa945a2af1839f1a08ecede331c64d0317
2023-07-11 17:59:24 +01:00
Jiakai Zhang
b1639db53f Extract duplicate code to common helper functions.
Also, fall back to using a default name for the dexpreopt directory if
we are not building for Android.

Bug: 290583827
Test: m nothing
Change-Id: I3fc6ff9142a2dcdf995796f75891b242fe2848d0
2023-07-11 17:59:05 +01:00
Colin Cross
4c90f99cb3 Use depsets for transitive manifests and assets
Instead of rolling assets and manifests up through each static lib,
provide them as a DepSet.  This will help with the next patch, which
needs to pass all the transitive manifests and R.txt files together.

Test: app_test.go
Change-Id: Id8b3aa2bed3771e82ab6bde192c9b43baa38b54c
2023-07-11 09:54:59 -07:00
Jiakai Zhang
da47d3c6f3 Fix dumpOatRules.
This method generates a build rule that runs oatdump for debugging
purposes.

- Pass "--runtime-arg -Xgc:CMC" to oatdump if UFFD GC is enabled.
- Build the phony name from the image name to avoid conflicts when using
  this method for multiple boot images.

Bug: 290583827
Test: m dump-oat-boot
Change-Id: I7adc97cb85b571486b78f173fb80ff7da2c4bfe4
2023-07-11 16:27:01 +01:00
Jiakai Zhang
f7f782c4f1 Remove Modules() from BootclasspathFragmentApexContentInfo.
The Modules() method was for the ART boot image in the ART APEX. It's no
longer needed because we don't install the ART boot image in the ART
APEX anymore.

Bug: 290583827
Test: m nothing
Change-Id: I674a5fa1ed18908413a64129df5947c7d26e638e
2023-07-11 15:29:17 +01:00
Jiakai Zhang
b69e89559f Fix some tests for dexpreopt and remove unnecessary tests.
This CL is to prepare for the changes in http://r.android.com/2652081.
See the description of that CL for the reasons.

Some tests were set up in a fragile way and were easy to be broken when
the implementation changes. This CL is a pure test change that fixes
them.

This CL also removes TestNoUpdatableJarsInBootImage. That test checks
what should go to the ART boot image and what should go to the
platform one, which does not apply today because boot images are not
associated with mainline modules anymore: a boot image may take jars
from multiple mainline modules and the platform, and a mainline module
can contribute to multiple boot images. In practice, we have ART jars in
the platform boot image, and we are going to add core-icu4j and
consrypt to the ART boot image, which is now for testing only.

Bug: 290583827
Test: m nothing
Change-Id: I22c45cbf6f853b030b68edb51197854e9c53a02e
2023-07-11 15:29:12 +01:00
Romain Jobredeaux
aa634fdbdb Merge "Support target and max sdk version in app bp2build." into main 2023-07-11 13:34:29 +00:00
Treehugger Robot
94c92f681a Merge "Copy imported APKs to output filename" into main am: 5af242249d am: 84d32c5b1c am: b4a858d7a0 am: 66baac045c am: 5dd8957f47 am: c873cb2da7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2652823

Change-Id: I51ab8c69b6ad17bad51ccddd1c07201d64e223d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 09:12:16 +00:00
Colin Cross
5780d57a71 Copy imported APKs to output filename
android_app_import and android_test_import modules with processed: true
and skip_preprocessed_apk_checks are used directly from the source tree.
If the source file name doesn t match the module name and the file is
used as test data it can result in the wrong filename being used.  Copy
the source file to an output file with the correct name first.

Bug: 290376750
Test: m CtsAppSecurityHostTestCases
Change-Id: I4a6dd1c5e48db7085ea41035def31f0844948a46
2023-07-10 22:18:01 +00:00
Romain Jobredeaux
496660d38a Support target and max sdk version in app bp2build.
Test: Unit tests + CI
Bug: 285304294
Bug: 280465047
Change-Id: I9bb1b6f9729ad783a43837d77dcf2d02b50ca77e
2023-07-10 11:50:00 -04:00
Treehugger Robot
5665622547 Merge "Implement OutputFileProducer for android_app_import and android_test_import" into main am: b2ace8d72d am: ed7ff79589 am: 58e3067618 am: 9d12e40dec am: 3fa8e286c3 am: 14fbf01979
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2652340

Change-Id: I646dc735f7fcc19586fea43614105a57e26fcf94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-08 04:37:36 +00:00
Colin Cross
5368d0b44a Implement OutputFileProducer for android_app_import and android_test_import
Fixes: 290376750
Test: builds
Change-Id: I5fc3a759462cfd4342b9330ac8978368feee26ca
2023-07-07 18:36:08 +00:00
Colin Cross
ff3ff7f354 Add tests for code that will be affected by resource processor feature
Add a test for the aapt2 resource processing code that will be affected
by the resource processor feature in a subsequent CL.

Test: TestAndroidResourceProcessor
Change-Id: I39712853f7bbfb7963f1b71e234d039d5ccaae53
2023-07-07 10:58:31 -07:00
Treehugger Robot
0f4d8f6866 Merge "Suppress resourceshrinker stdout in soong" am: ece97e5658 am: 1890f082a7 am: b12365df34 am: 7a67e5ca42 am: 64b4d69f9e am: f5898b3e40
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2629191

Change-Id: I7436a36ced5506e98a03eb318032ff6d5784240e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-01 03:49:14 +00:00
Treehugger Robot
ece97e5658 Merge "Suppress resourceshrinker stdout in soong" 2023-06-30 23:26:28 +00:00
Nicolas Geoffray
b37e2183a3 Merge "Don't strip oat files on host." am: 3799533b87 am: 51ba0cf62a am: 5f1a60b3ff am: 3329a4e764 am: 032c8074b1 am: b603b627a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2640035

Change-Id: I05ce41cb4231c763f70c901919c9042e1bb76dcc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-30 14:54:34 +00:00
Treehugger Robot
ddf027b4a0 Merge "Extract class files from dep_api_srcs instead of java files" am: 043893465c am: e2be65ac9b am: c3f42dcf7b am: 52adedba36 am: c2c0f70a59 am: b87706fec2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2637669

Change-Id: I448ffec69b79a46af302bf2b6d9fe1e7469db674
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-30 13:34:46 +00:00
Nicolas Geoffray
3799533b87 Merge "Don't strip oat files on host." 2023-06-30 10:49:50 +00:00