Commit graph

7140 commits

Author SHA1 Message Date
Romain Jobredeaux
f1a3d7a303 Merge changes from topic "bazel_framework_res" into main am: 641b62b205 am: b0e61183f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2720593

Change-Id: I982a8d244d21dba4d09d2e568f03fecf1ac1d508
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 22:53:48 +00:00
Romain Jobredeaux
641b62b205 Merge changes from topic "bazel_framework_res" into main
* changes:
  bp2build support for framework-res
  Keep rules_testing BUILD files
2023-09-27 20:52:50 +00:00
Jihoon Kang
daa3a1a2db Merge changes from topic "expose_flagged_api" into main am: af26c102b8 am: ff593197d9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755310

Change-Id: I151c659f99d71568c7e75ea4f679aa9d60abad56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 19:47:53 +00:00
Zi Wang
1066479258 Always drop deps from android_library with no srcs
android_library does not accept deps when there are no srcs because
there is no compilation happening. The libs of android_library module
are unnecessary as deps on the android_library since they aren't
being propagated to any dependencies.
So we can drop deps here.

Test: the updated test case and CI

Bug: 302290600

Change-Id: Ib43a1c273a5f3b3e0aa6f29f4e8569ad3487e451
2023-09-27 12:36:36 -07:00
Jihoon Kang
d91a8e806a Add flagged api hide conditional to droidstubs
APIs annotated with @FlaggedApi should not be included in the artifact
when building sdk target products in the "next" release configuration.

This change adds such logic by passing additional flag to metalava in
droidstubs.

The flag does not need to be passed to metalava invocation done in
java_api_library, as java_api_library generates stubs using api
signature files (i.e. *-current.txt files), and they will not contain
apis marked @FlaggedApi. The metalava invocation in droidstubs is
responsible for removing such apis.

Test: go test ./java && m TARGET_PRODUCT=sdk TESTING_TARGET_RELEASE_NEXT=true nothing and inspect ninja command for generating stubs and verify the flag is included
Bug: 299570421
Change-Id: Ia4b699b6e3ff6324f050eecc9ff5b622fdc04621
2023-09-26 22:46:05 +00:00
Romain Jobredeaux
2682639f03 Merge "Do not convert android_library_import with no aars." into main am: 832e131725 am: 51cab22f4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2760791

Change-Id: Ic0c114edd4d65f57a7c6038d865db81e67ce352e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 21:39:31 +00:00
Romain Jobredeaux
832e131725 Merge "Do not convert android_library_import with no aars." into main 2023-09-26 20:08:04 +00:00
Colin Cross
e693d617c2 Merge "Shard srcjars when sharding javac compilation" into main am: b983ceac33 am: 9a21f40742
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2762551

Change-Id: Iab092236065583a885abddac58505e0ff79a66ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 19:20:40 +00:00
Romain Jobredeaux
9c06ef353b bp2build support for framework-res
Change-Id: I5b32a702e02b5f1ec08d5608d766a8a0c08d845c
Bug: 276928228
Bug: 297356405
2023-09-26 15:06:50 -04:00
Colin Cross
b983ceac33 Merge "Shard srcjars when sharding javac compilation" into main 2023-09-26 18:01:49 +00:00
Treehugger Robot
36b815461a Merge "Improve optimize bp2build conditional." into main am: 8559872623 am: 6c49c4a1d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2762806

Change-Id: Ib480e7bf5525173b01ae47846cd721e5c992fd3c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 17:00:16 +00:00
Jingwen Chen
256c389608 Improve optimize bp2build conditional.
Follow up from https://android-review.git.corp.google.com/c/platform/build/soong/+/2757255/comment/fdcf5795_943a04d5/

Test: soong unit tests
Change-Id: I63334bfd19469060673e9a9a239050590934b089
2023-09-26 05:56:54 +00:00
Colin Cross
a052ddbb7e Shard srcjars when sharding javac compilation
java_library rules with javac_shard_size set split the sources into
shards to invoke javac multiple times, but were using a single javac
invocation for all srcjars.  For fraemwork-minus-apex, this srcjar
shard was the long pole at 15.7 seconds, containing 266 srcjars with
1542 java files with a total of 614593 lines.

Use a rough approximation of 5 sources per srcjar to determine the
number of shards to split the srcjars into based on javac_shard_size.
This results in splitting the srcjars for frameworks-minus-apex into
8 shards, with the longest taking 10.5 seconds to compile.

The longest shard contains most of the aidl srcjars, which have been
generated by sharded groups of 50 aidl files and have a much higher
average number of sources per srcjar (a mean and median of 27).  A
future improvement could be to shard those separately assuming a
higher number of sources per srcjar.

Bug: 302033097
Test: USE_RBE=false m frameworks-minus-apex
Change-Id: I85e740c7fcf5651cf18c0cdc90ab8c6ee39cb47b
2023-09-25 21:46:58 -07:00
Jihoon Kang
1eaf6404ab Merge changes from topics "remove_api_files", "remove_naming_convention" into main am: 534e2e504d am: 426d016353
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2758365

Change-Id: I2e80357f673486b0160fa0569e0990d1a726b3d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 00:36:29 +00:00
Jihoon Kang
534e2e504d Merge changes from topics "remove_api_files", "remove_naming_convention" into main
* changes:
  Remove naming conventioned based file sorting in java_api_library
  Remove api_files property from java_api_library
2023-09-25 22:31:53 +00:00
Treehugger Robot
b70f9d862d Merge "Enable/disable optimize for android_test and android_test_helper_app by default." into main am: b95a8b33be am: f9827be517
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757255

Change-Id: I19a05327569f6ef734c4993d7e084baf10694f28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-25 19:10:13 +00:00
Jingwen Chen
65229207d1 Enable/disable optimize for android_test and android_test_helper_app by default.
Follow up to https://android-review.git.corp.google.com/c/platform/build/bazel/+/2727853/comment/f2c5802e_245fd302/

Test: New unit tests, presubmits
Test: `atest-dev HelloWorldTests --roboleaf-mode=dev`

Change-Id: I88efcf72fbcb717d05e71ba50ba7802c3bece816
2023-09-25 15:27:33 +00:00
Zi Wang
894e5ee4c9 Merge "Pass java_library libs and static_libs to java_*_proto_library" into main am: 7c5b6d5273 am: ada4983493
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2759538

Change-Id: I5135ef9ada4e3d6a4bfe104c90b6ffd3d7fe5d02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-23 05:57:39 +00:00
Zi Wang
7c5b6d5273 Merge "Pass java_library libs and static_libs to java_*_proto_library" into main 2023-09-23 03:45:48 +00:00
Treehugger Robot
be9f6850a7 Merge "Switch bp2build mutator to bottom up" into main am: 11b20b2993 am: febe41d738
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2760865

Change-Id: I5338f3d74461eaa752ef63eb3e422ae9f4d49771
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-23 02:20:15 +00:00
Romain Jobredeaux
afc5d27ab0 Do not convert android_library_import with no aars.
Bug: 301007952
Change-Id: Ia32d47eeb1a888ea2555d5ca08f56f191c040bc7
2023-09-22 15:52:59 -04:00
Chris Parsons
6666d0f6b1 Switch bp2build mutator to bottom up
This should be no-op, as the underlying mutator has not changed yet.

Some other refactoring is required and done in this CL:

- Delete some old, dead ApiBp2build code
- Fix casting to TopDownMutator when it's not necessary

This change is required to prepare for allowlist v2 work, as only
BottomUp mutators can AddDependency.

Bug: 285631638
Test: m nothing
Test: presubmits
Change-Id: I5212a5f5634cc13056195783e6df37ff8eb000da
2023-09-22 19:19:22 +00:00
Zi Wang
4dbd0e8688 Pass java_library libs and static_libs to java_*_proto_library
If a java_library module has proto srcs, a java_*_proto_library target
will be created for it. Proto sources are generated and then compiled
by a java_library target. We need to pass the libs and static_libs of
the java_library module to this java_library target so that
the compile-time classpath is correct.

Test: updated unit tests and CI

Bug: 301469542
Change-Id: I05b2efce6fda2223e85728b3c4c7b1815d04c3dd
2023-09-22 11:20:06 -07:00
Jihoon Kang
a96a7b1e13 Remove naming conventioned based file sorting in java_api_library
With api_files property being removed from java_api_library, all api
files are passed to java_api_library via java_api_contribution, which
provide api_surface information. Instead of relying on the naming
convention of the api files, java_api_library can utilize this
information to sort the api files from narrower api scope to the wider
api scope.

Test: m --build-from-text-stub
Bug: 295429988
Change-Id: Idd832778833c072c6b7e9d1f775533e5f4e2af00
2023-09-22 16:55:43 +00:00
Jihoon Kang
0fbb6e2502 Merge "RESTRICT AUTOMERGE Move java_api_library modules to f/b/api/StubLibraries.bp" into udc-dev-plus-aosp 2023-09-22 16:38:24 +00:00
Alix Espino
540f688f3f Merge "Mark android_* modules with java_resources as unconvertible" into main am: c62b27a7ea am: ea88c79b2e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752994

Change-Id: Iad5a2b58ed2c08e7d35ade80ec23d1552e06e937
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-22 15:30:57 +00:00
Alix Espino
c62b27a7ea Merge "Mark android_* modules with java_resources as unconvertible" into main 2023-09-22 14:56:18 +00:00
Jihoon Kang
818f3d9485 RESTRICT AUTOMERGE Move java_api_library modules to f/b/api/StubLibraries.bp
This change was already submitted with
https://android-review.git.corp.google.com/q/topic:%22revert-2713677-revert-2655262-move_java_api_libraries-JTESUMBERD-FPSEKJYXCE%22
but was never propagated to downstream.

Ignore-AOSP-First: change already merged in aosp

Test: m nothing --build-from-text-stub
Change-Id: I1f2f33e1a5df6f7b8f8215ab41b41228fa873ea1
2023-09-22 00:29:17 +00:00
Romain Jobredeaux
4ed82da99d Merge "Use raw {min,target}_sdk_version properties in android_app converter" into main am: 2c11851598 am: 09ac546858
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752828

Change-Id: I65a7058271eee0e268c150b3ff190aa7bc71f29b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 22:21:20 +00:00
Jihoon Kang
6be0f00671 Remove api_files property from java_api_library
java_api_contribution provides api_surface information, but files
directly passed to java_api_library do not possess such information.
Currently, the api surface is assumed via naming convention for api
files passed via api_files property, but this is fragile.

This change removes the api_files property from java_api_library and
enforce all api files to be passed via java_api_contribution

Test: m nothing --build-from-text-stub
Bug: 300964421
Change-Id: If01d9ed978fe469d4ee0d685582a51629ebecc56
2023-09-21 21:02:39 +00:00
Romain Jobredeaux
2c11851598 Merge "Use raw {min,target}_sdk_version properties in android_app converter" into main 2023-09-21 20:58:16 +00:00
Treehugger Robot
7204781c24 Merge "Revert^2 "bp2build converter for android_test_helper_app."" into main am: a56002a473 am: f7566167dd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2759108

Change-Id: I718a02e4d41559347cbf6ec6c7032a6fd691503c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 18:46:13 +00:00
Jingwen Chen
7f2170b57f Merge "Revert "bp2build converter for android_test_helper_app."" into main am: 38b7be9d29 am: 050f0fa35b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2759106

Change-Id: I0adb36e537dd590d827669b76fafce2a92eef479
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 16:04:58 +00:00
Jingwen Chen
47eb84435b Merge "bp2build converter for android_test_helper_app." into main am: 72e22018c3 am: 915ddd751b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757525

Change-Id: I592afba5251e1d949af14b2758785be967a41d12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 16:04:34 +00:00
Romain Jobredeaux
5610f9ceb6 Merge "Bp2build support for JNI deps of android_app." into main am: 1c4048e08d am: 4bc34aa84e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2622674

Change-Id: I7fbd8985c92404e17bd5b58ec2c173f869585967
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 16:04:20 +00:00
Jingwen Chen
050f0fa35b Merge "Revert "bp2build converter for android_test_helper_app."" into main am: 38b7be9d29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2759106

Change-Id: I2c0c4621425d709ee3d98bdeaf5ebe00a0ee3aaa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 16:00:14 +00:00
Jingwen Chen
915ddd751b Merge "bp2build converter for android_test_helper_app." into main am: 72e22018c3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757525

Change-Id: I6ce6183e2ae3a2a0ebc5dfc8884fb27268831a7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 15:59:43 +00:00
Jingwen Chen
6528999872 Revert^2 "bp2build converter for android_test_helper_app."
2395286cda

Change-Id: I698c1e62b87f3d8338d8d207d06f62ec680d71c9
2023-09-21 15:16:59 +00:00
Jingwen Chen
38b7be9d29 Merge "Revert "bp2build converter for android_test_helper_app."" into main 2023-09-21 15:14:29 +00:00
Jingwen Chen
2395286cda Revert "bp2build converter for android_test_helper_app."
Revert submission 2757525-android_test_helper_app

Reason for revert: broke builds

Reverted changes: /q/submissionid:2757525-android_test_helper_app

Change-Id: I0e5f55078221d7f2151f1bbaa55bebdf5051c03c
2023-09-21 15:12:19 +00:00
Jingwen Chen
72e22018c3 Merge "bp2build converter for android_test_helper_app." into main 2023-09-21 15:09:06 +00:00
Romain Jobredeaux
4bc34aa84e Merge "Bp2build support for JNI deps of android_app." into main am: 1c4048e08d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2622674

Change-Id: Ie3d0fefd42a14038e97cbecb5e93f677dca3cbda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 15:04:52 +00:00
Romain Jobredeaux
1c4048e08d Merge "Bp2build support for JNI deps of android_app." into main 2023-09-21 14:36:02 +00:00
Treehugger Robot
2b93f0cfb9 Merge "Mark android apps with jni_uses_*_apis as unconvertible" into main am: 8d3ea47ec1 am: a1b17990dd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755569

Change-Id: I706967f2c3bc0798306ce7ef7d367bbe08923528
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 04:25:12 +00:00
Treehugger Robot
a1b17990dd Merge "Mark android apps with jni_uses_*_apis as unconvertible" into main am: 8d3ea47ec1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755569

Change-Id: I1fc63295438b1e33ab5d7a21dfdc21f8469f7507
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 04:20:01 +00:00
Alix
ee51bd6588 Mark android_* modules with java_resources as unconvertible
Change-Id: I9da921feaf9edb5fe7d1b1cb733494f90d8c64b3
BUG: 300470246
2023-09-21 03:58:24 +00:00
Treehugger Robot
8d3ea47ec1 Merge "Mark android apps with jni_uses_*_apis as unconvertible" into main 2023-09-21 03:38:05 +00:00
Treehugger Robot
ba8d17586a Merge "Enable restat for kapt stubs rules" into main am: f2d858e5ba am: 61958c4581
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755510

Change-Id: I623bf8f9ecec17b6e85675246b01acd6be0a5951
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 22:10:16 +00:00
Treehugger Robot
99ccb40d0a Merge "Use same symbol for all receiver functions" into main am: 7ae5a5b8cb am: 1ceda3d5f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2756985

Change-Id: I9f0bf636c62b05a7d41c6b11930f6d77a207b38c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 22:10:05 +00:00
Treehugger Robot
61958c4581 Merge "Enable restat for kapt stubs rules" into main am: f2d858e5ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755510

Change-Id: Id1bda3613b5073ccd8786e81379676f08d637d55
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 21:12:53 +00:00
Treehugger Robot
1ceda3d5f8 Merge "Use same symbol for all receiver functions" into main am: 7ae5a5b8cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2756985

Change-Id: I75bf73d10820621dac581358255f9d0295510d50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 21:12:40 +00:00
Treehugger Robot
f2d858e5ba Merge "Enable restat for kapt stubs rules" into main 2023-09-20 20:40:28 +00:00
Romain Jobredeaux
947dfa760b Bp2build support for JNI deps of android_app.
Change-Id: I3f934ecb0323129e1bb1eb75527395e39467380d
Bug: 297405812
2023-09-20 16:09:13 -04:00
Spandan Das
0e0a880fdd Mark android apps with jni_uses_*_apis as unconvertible
These properties are used to determine if the app should include the sdk
variant of jni libs. Till we support this, mark androi_app/android_test
that set this property as uncovertible in allowlist v2

Bug: 299360988
Test: created a test app in an android.bp and verified that an
equivalent target is not created if either of these props are set

Change-Id: I925745d2667866a12b71788dc8f1bb1e1f3472cc
2023-09-20 19:53:30 +00:00
Christopher Parsons
88db04e1a9 Merge "Have ConvertWBp2build use Bp2buildMutatorContext" into main am: c331812a59 am: 95f97af223
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2756986

Change-Id: If359a892ba0234fd8cb6842bfb0109644bd1a448
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 18:36:11 +00:00
Christopher Parsons
95f97af223 Merge "Have ConvertWBp2build use Bp2buildMutatorContext" into main am: c331812a59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2756986

Change-Id: I541a63831ce789071cae8554e801fe323be3c6bd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 18:32:15 +00:00
usta
0391ca4eaa Use same symbol for all receiver functions
cosmetic change

Bug: NA
Test: NA
Change-Id: I1781de1bd2108547f4da2a967d72a3a56e7362ed
2023-09-20 18:01:44 +00:00
Colin Cross
ed27322aa5 Enable restat for kapt stubs rules
The output of the kapt stubs rules only change when the public interface
of a kotlin class changes, which makes them a good candidate for restat.
This will prevent some unnecessary reruns of turbine annotation
processing.

Bug: 297356926
Test: builds
Change-Id: I39bd63284fd37058f69a0a3dace1ea5f4f50e8b5
2023-09-20 09:53:39 -07:00
Liz Kammer
336739ca4a Merge changes from topic "prebuilt-cc-shared-always" into main am: 9e12c78637 am: c4298a325d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755385

Change-Id: I7e9b54f36fa6fb32b3c070579859a66bdf3600d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 15:01:49 +00:00
Chris Parsons
637458d326 Have ConvertWBp2build use Bp2buildMutatorContext
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.

Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
2023-09-20 14:49:35 +00:00
Jingwen Chen
2848be4236 bp2build converter for android_test_helper_app.
This module converts simply to an android_binary, but with testonly = True.

Test: new unit tests
Test: new example app
Fixes: 283518652
Change-Id: If6b7661c32caa7dada6d492cce106d96236f6205
2023-09-20 14:31:17 +00:00
Liz Kammer
c4298a325d Merge changes from topic "prebuilt-cc-shared-always" into main am: 9e12c78637
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755385

Change-Id: Id551b291d40a64b5c48aea5e77bf0e47941408fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 14:03:51 +00:00
Christopher Parsons
aa457e173a Merge "Refactor bp2build tests for allowlist v2" into main am: 06ac78ce40 am: 3092afc3c2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755925

Change-Id: Id717d1038a870056db7ff47701e196410b979615
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 21:21:36 +00:00
Christopher Parsons
3092afc3c2 Merge "Refactor bp2build tests for allowlist v2" into main am: 06ac78ce40
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755925

Change-Id: I67fedb5715b0d6cdb90f7f7af0187289a504f955
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 20:24:22 +00:00
Liz Kammer
9a97a8f62a Implement bp2build for java_sdk_library_import
Test: go test bp2build conversion tests
Test: enable modules build from prebuilt and m nothing
Bug: 300640274
Change-Id: I8c015aec546d052bef6c42869e12db4e87d39780
2023-09-19 15:58:22 -04:00
Chris Parsons
cd209035aa Refactor bp2build tests for allowlist v2
Allowlist v2 will change bp2build by automatically disabling rdeps of
unconvertible modules. Many bp2build tests create bp2build stub modules
without an implementation,
This CL changes setup of such tests to also contain a BUILD file with
"stub implementations" of equivalent targets, to keep these test targets
convertible.

To verify this change in-place, this CL removes `bp2build_available:
false` from these dependencies.

This is a test-only change for bp2build tests.

Bug: 285631638
Test: m bp2build
Change-Id: I489480cbc4158a416b7abf57c35a6e2bc2ad6173
2023-09-19 17:04:11 +00:00
Jingwen Chen
3a02b22205 Merge "[bp2build] android_test bp2build." into main am: 088c4b652b am: 3aaf1a80bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2727561

Change-Id: I629c0b2f44b1a50cb4f487d077f63036cf96862d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 00:11:04 +00:00
Jihoon Kang
567f0186a3 Merge "Create java_api_contribution_import from sdk_library_import" into main am: 18a33e51c6 am: 578ece61ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2748475

Change-Id: Ia0ecca22ae35d210bec2567f0c3adbacb38860fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 00:10:55 +00:00
Treehugger Robot
0053d8082b Merge changes I8466db71,I83180699 into main am: e50b0f5558 am: 0efaada4cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752165

Change-Id: Id91c263c06e3316ad27b237ce475a65384b6bdf0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 00:09:38 +00:00
Jingwen Chen
3aaf1a80bd Merge "[bp2build] android_test bp2build." into main am: 088c4b652b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2727561

Change-Id: Id15bc7e836370645f6777ecc4ad1f34cd678ba07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 00:04:46 +00:00
Jingwen Chen
088c4b652b Merge "[bp2build] android_test bp2build." into main 2023-09-18 23:27:14 +00:00
Jihoon Kang
578ece61ed Merge "Create java_api_contribution_import from sdk_library_import" into main am: 18a33e51c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2748475

Change-Id: I86d682265a510ee60359c2517250c5f7459d3182
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 23:16:25 +00:00
Treehugger Robot
0efaada4cd Merge changes I8466db71,I83180699 into main am: e50b0f5558
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752165

Change-Id: Ic32fdf1452442b879c86d52f94f9de03317ae566
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 23:15:08 +00:00
Jihoon Kang
18a33e51c6 Merge "Create java_api_contribution_import from sdk_library_import" into main 2023-09-18 22:24:51 +00:00
Treehugger Robot
e50b0f5558 Merge changes I8466db71,I83180699 into main
* changes:
  Sort api files by api surface in java_api_library
  Add java_api_contribution_import module type
2023-09-18 22:23:33 +00:00
Treehugger Robot
96d1710972 Merge "Unconditionally generate hash-based proguard mapping files" into main am: 46465666cc am: 92547162cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752996

Change-Id: I25d720af1c0cfc711a77e31f66506bd767353672
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 20:34:27 +00:00
Treehugger Robot
fcc7fcf1eb Merge "don't compress JNI libs extracted from aar_import" into main am: 35bc07cb2a am: 16542620eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2636192

Change-Id: I44642943e4154ac2d13cdfbdcda4a6bc5035838a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 20:33:46 +00:00
Jihoon Kang
71c868340e Create java_api_contribution_import from sdk_library_import
This change modifies sdk_library_import so that it directly creates
java_api_contribution per api scope. The module creates api_contribution
module for api scopes where the api file is specified.

Test: m nothing && MODULE_BUILD_FROM_SOURCE=false m nothing
--build-from-text-stub and inspect ninja dependency of java_api_library
Bug: 300175323

Change-Id: I74be3b4f1efef7f7d1cb8bd7b6c893b9cef0f370
2023-09-18 19:33:28 +00:00
Jihoon Kang
8fe1982e8b Sort api files by api surface in java_api_library
metalava requires api files to be sorted in the narrower api scope to
the wider api scope when passed as inputs. Previously, the api files
were sorted based on the naming convention, but some api files in
prebuilts do not necessarily follow the naming convention (i.e.
*-current.txt). Therefore, utilize the api surface information provided
by the java_api_contribution provider instead of the naming convention
to sort the api files.

Test: m nothing
Bug: 300175323
Change-Id: I8466db712bff8fef906186bd272d85682877533d
2023-09-18 19:33:01 +00:00
Treehugger Robot
92547162cd Merge "Unconditionally generate hash-based proguard mapping files" into main am: 46465666cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752996

Change-Id: I826e56a4f20739e0fc05f94ecddb68b6fc938309
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 18:56:21 +00:00
Treehugger Robot
16542620eb Merge "don't compress JNI libs extracted from aar_import" into main am: 35bc07cb2a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2636192

Change-Id: I7c94b0fb24d2c4a272308a932f1261638d94a546
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 18:56:02 +00:00
Treehugger Robot
46465666cc Merge "Unconditionally generate hash-based proguard mapping files" into main 2023-09-18 18:33:38 +00:00
Treehugger Robot
35bc07cb2a Merge "don't compress JNI libs extracted from aar_import" into main 2023-09-18 18:20:52 +00:00
Jared Duke
b832fbb643 Unconditionally generate hash-based proguard mapping files
Previously, this was restricted to targets that enable R8 full mode, but
that was really just a temporary carveout to avoid disrupting other
targets. Since then, R8 full mode has been enabled by default for all
app targets, and the hash-based mapping mechanism is further integrated
into various debugging and retracing pipelines.

As of now, there are are only a very small number of targets that have
enabled optimization/obfuscation and are still using R8 compat mode, so
the build-time impact of this change should be minimal, and there should
be no functional runtime side effects.

Bug: 297566172
Test: m framework-appsearch + inspect proguard mapping
Change-Id: I5dfea60f60dc37b8445c8fddba6a4eab0dc41d96
2023-09-18 16:05:16 +00:00
Romain Jobredeaux
3132f843f1 Use raw {min,target}_sdk_version properties in android_app converter
The logic of EffectiveVersionString is product-variable dependent and
is being implemented bazel-side in order to produce product agnostic
BUILD files. A required additional product variable is added to the
export list, and the "updatable" property of android_app is also bp2build-converted.
Handling of max sdk version was not correct (it does not affect
manifest values in Soong), so removing it for now.

Bug: 274474008
Bug: 274474002
Test: CI
Change-Id: I7a10bfabf914c8e86064b7ce61926701f87517e3
2023-09-18 10:02:35 -04:00
Jingwen Chen
e12c083198 [bp2build] android_test bp2build.
android_test is just an android_app, but the test bits are handled
purely in Starlark (tradefed_test_impl).

This enables building HelloWorldTests (android_test) with Bazel.

Bug: 297030120
Bug: 297029612
Test: WIP
Change-Id: I6d287c94b31698ea247da48e4cd6b5a75bc71e11
2023-09-18 12:39:06 +00:00
Jihoon Kang
fdf323697e Add java_api_contribution_import module type
java_api_contribution_import is a prebuilt module type of
java_api_contribution. It's build actions are identical to those of
java_api_contribution.

Test: m nothing
Bug: 300174357
Change-Id: I831806990b37b340af21858eb2bab5de62fdf7a9
2023-09-15 22:52:52 +00:00
Zi Wang
7ccd48617c Merge changes from topic "drop_deps_no_srcs" into main am: 5d982b398e am: cccefd7433
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752995

Change-Id: I2bf4f8a67332da3d970ed7e24fc612658c4523ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 21:57:54 +00:00
Zi Wang
cccefd7433 Merge changes from topic "drop_deps_no_srcs" into main am: 5d982b398e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2752995

Change-Id: I095b48f0bbe31fdc65df43a81693b7dfb7c60da8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 20:59:17 +00:00
Zi Wang
5d982b398e Merge changes from topic "drop_deps_no_srcs" into main
* changes:
  Always drop deps from java_library with no srcs
  Do not append deps to exports when java_library has only proto srcs
2023-09-15 20:39:35 +00:00
Zi Wang
dd93636f1e Always drop deps from java_library with no srcs
This is the follow up from aosp/2750763

Test: CI and added unit test

Bug: 285952385
Change-Id: I64703ee4fa742b718ffb43f2af1b6ab43ddeb606
2023-09-15 10:37:16 -07:00
Usta (Tsering) Shrestha
7110fa52bb Merge "Bp2build-convert droiddoc_exported_dir" into main am: 4e86d7a342 am: 8ae2b77eaa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2734933

Change-Id: I33b0c647364ac9f252b8f020a5eb4f3cc1472080
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 21:42:14 +00:00
Usta (Tsering) Shrestha
8ae2b77eaa Merge "Bp2build-convert droiddoc_exported_dir" into main am: 4e86d7a342
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2734933

Change-Id: I27cccf8626c2ae3a29816b5fa4a94b9c67f7182d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 20:44:17 +00:00
usta
72c6c6c8be Bp2build-convert droiddoc_exported_dir
Bug: 283299388
Test: `m bp2build` and manual inspection
Change-Id: Ieec2094e446bb030f30103a7e1a06e35cbdcc72e
2023-09-14 12:06:54 -04:00
Cole Faust
0fd5fd76eb Merge "Error out if skip_preprocessed_apk_checks is set when it's not necessary" into main am: 3835509f95 am: 14469155af
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2744114

Change-Id: I48988961f898c44741765db93636be923bf105d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 00:46:36 +00:00
Cole Faust
14469155af Merge "Error out if skip_preprocessed_apk_checks is set when it's not necessary" into main am: 3835509f95
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2744114

Change-Id: I271bc87a21adb967073ece7de25a602ff0b10894
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 23:50:22 +00:00
Cole Faust
3835509f95 Merge "Error out if skip_preprocessed_apk_checks is set when it's not necessary" into main 2023-09-13 22:38:33 +00:00
Zi Wang
f038cde8df Do not append deps to exports when java_library has only proto srcs
This is to address the comment in aosp/2748099

Test: CI

Bug: 285952385
Change-Id: I0bc8c76e2bc9ee113ced8642e0ab93a95799211c
2023-09-13 10:15:10 -07:00
Jihoon Kang
17cec69ff7 Merge "Utilize -quiet flag in java_api_library" into main am: ef1fc04e1a am: 8f9e1c9f85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2749441

Change-Id: I8a516ff4158b597a5030dbc9ad5127b74c0773fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 17:14:23 +00:00
Jihoon Kang
8f9e1c9f85 Merge "Utilize -quiet flag in java_api_library" into main am: ef1fc04e1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2749441

Change-Id: I4adba57beef04d888e794f48b573c74de8f9d18f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 16:19:57 +00:00