Commit Graph

7964 Commits

Author SHA1 Message Date
Anton Hansson
b06bb5762e Support passing lint baseline to doclava
There are many issues in the docs, so allow specifying a baseline
file that allows existing lint errors in doclava.

Bug: 217734059
Test: m docs
Change-Id: I8997e47a497e1366247e8354be492805f300a16e
2023-10-03 12:15:19 +00:00
Thiébaud Weksteen
22d532eb84 Merge changes from topic "linter_integration_tests" into main am: 77b232da24 am: 11e2cee9a6 am: 9e0a9d859a am: 82dd82e3ae am: 81b389f0a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769019

Change-Id: I9dfcbceca891f73825f090d7a2e6e1152a4d80f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 01:27:26 +00:00
Jihoon Kang
c831389625 Revert^2 "Add flagged api hide conditional to droidstubs"
This reverts commit 1180919dda.

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 && m TARGET_PRODUCT=sdk TARGET_RELEASE=trunk_food nothing and inspect ninja command for generating stubs and verify the flag is not included
Bug: 299570421
Change-Id: I4967376c0236bad729398af80fa59b48dbab5f21
2023-10-03 01:04:00 +00:00
Thiébaud Weksteen
9e0a9d859a Merge changes from topic "linter_integration_tests" into main am: 77b232da24 am: 11e2cee9a6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769019

Change-Id: Id42122ad6f40e317cec4a05e0989f15197d22d0b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 23:59:43 +00:00
Thiébaud Weksteen
77b232da24 Merge changes from topic "linter_integration_tests" into main
* changes:
  Add .lint tagged output to Java modules
  Add lint.suppress_exit_code attribute
2023-10-02 23:26:39 +00:00
Yu Liu
f2b94010c8 Convert java_aconfig_library to bazel.
Bug: 297357579
Test: Unit test and AconfigJavaHostTest
Change-Id: Icf944cc0b2a7382107923d49b2d2ff0eb4113638
2023-10-02 15:04:19 -07:00
Thiébaud Weksteen
d054436434 Add .lint tagged output to Java modules
The linter output can be referenced in other modules for further
processing.

Bug: 302400088
Test: m nothing
Change-Id: I1809b70d8d98ced5d8f3d5f068c6639c782ebebc
2023-10-02 10:12:30 +11:00
Treehugger Robot
ad12032697 Merge "Delete temporary files after d8 and r8 rules" into main am: 956f79c5d4 am: 737cf4dc67 am: ad0a6f614f am: 1a24a815e0 am: 780c2f3804
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768187

Change-Id: I9649fda5a8d9f97f27359820a8d0f25bba273a54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 17:40:42 +00:00
Treehugger Robot
ad0a6f614f Merge "Delete temporary files after d8 and r8 rules" into main am: 956f79c5d4 am: 737cf4dc67
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768187

Change-Id: I0605811c5d0e17a4b8d4e69f9502869924f6ef7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 14:35:42 +00:00
Treehugger Robot
956f79c5d4 Merge "Delete temporary files after d8 and r8 rules" into main 2023-09-29 13:27:57 +00:00
Colin Cross
56e2840a57 Delete temporary files after d8 and r8 rules
Delete files created within the d8 and r8 rules that are not considered
output files by ninja.  This should reduce disk space usage without
affecting incremental build performance.

Bug: 302573555
Test: m checkbuild
Change-Id: Ifea86888c2f385415735ade7d80cf315bc4d057e
2023-09-28 17:43:35 -07:00
Thiébaud Weksteen
9c0dff9ae5 Add lint.suppress_exit_code attribute
The Android lint --exitcode parameter can be skipped using
ANDROID_LINT_SUPPRESS_EXIT_CODE. Expose a similar attribute to Java
modules to ignore the exit code.

This is useful for integration testing. It is possible to build
libraries that report an error when linted. Othewise, such module would
break the checkbuild target.

Bug: 302400088
Test: m nothing
Change-Id: I372c42184f40d25753a688c380c0c63e9758ca00
2023-09-29 10:24:13 +10:00
Anton Hansson
e2b3f8345f Merge "Make the srcjar for bcp available in OutputFiles" into main am: 0843b79d8c am: 4e34213372 am: 3efbb3649e am: 26a393ca27 am: 11c46f75ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2760367

Change-Id: I0eb48b2f5a650c7c37e443f2b0c5cd7ffd38ffc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 20:45:53 +00:00
Anton Hansson
9f641836e3 Merge "Add srcjar output for platform_bootclasspath" into main am: c38757d0c0 am: 10d91d7107 am: f7931b390a am: 46d7ab27c5 am: 397031a094
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757569

Change-Id: Id0a8acac327fea8f2e2095d38912644ba58c2627
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 20:45:44 +00:00
Anton Hansson
1ed4305d11 Merge "Collect transitive source files for java modules" into main am: 9231132099 am: ea95719555 am: 4a1fdf1964 am: 5fd22da744 am: 8a03b6ba70
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757568

Change-Id: I08ab8937b7c791c6e7c8440e3c794c59abd28ae5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 20:45:34 +00:00
Zi Wang
e2929e42a4 Merge "Always drop deps from android_library with no srcs" into main am: 2201343fce am: 50225c86b6 am: 965367f3e0 am: 489210e8c4 am: 4230ef999f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2765453

Change-Id: I852f8ebfdd9974e8ab21c47e85b2a107876bdba3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 20:44:34 +00:00
Anton Hansson
3efbb3649e Merge "Make the srcjar for bcp available in OutputFiles" into main am: 0843b79d8c am: 4e34213372
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2760367

Change-Id: Ifdcedf2168b38559e2c5973bbacb5ad3ae38dd3e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 18:28:58 +00:00
Anton Hansson
f7931b390a Merge "Add srcjar output for platform_bootclasspath" into main am: c38757d0c0 am: 10d91d7107
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757569

Change-Id: I6ebb3f0be38af38f2f862593a3f185579d231d7d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 18:28:50 +00:00
Anton Hansson
4a1fdf1964 Merge "Collect transitive source files for java modules" into main am: 9231132099 am: ea95719555
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757568

Change-Id: Idad894c8cf621d172f8dc6f9504064de379d0bec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 18:28:40 +00:00
Zi Wang
965367f3e0 Merge "Always drop deps from android_library with no srcs" into main am: 2201343fce am: 50225c86b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2765453

Change-Id: I1e4500e867959ceae0e96498fa6270772513befa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 18:27:58 +00:00
Anton Hansson
0843b79d8c Merge "Make the srcjar for bcp available in OutputFiles" into main 2023-09-28 17:09:50 +00:00
Anton Hansson
c38757d0c0 Merge "Add srcjar output for platform_bootclasspath" into main 2023-09-28 16:56:55 +00:00
Anton Hansson
9231132099 Merge "Collect transitive source files for java modules" into main 2023-09-28 16:46:30 +00:00
Zi Wang
2201343fce Merge "Always drop deps from android_library with no srcs" into main 2023-09-28 16:16:51 +00:00
Anton Hansson
b3738ed1f4 Make the srcjar for bcp available in OutputFiles
This makes it possible for Android.bp files to depends on the srcjar.

Bug: 151360309
Test: m platform-bootclasspath.srcjar
Change-Id: Id42cc3cff89c084b55c7fb0726ad84ecd4f50f58
2023-09-28 13:22:39 +00:00
Anton Hansson
57162c515e Add srcjar output for platform_bootclasspath
This output contains all the transitive sources that are contained in
the bootclasspath.

It's currently limited to source-built bootclasspath components. Future
work will make this deal with sdk_library prebuilts.

Bug: 151360309
Test: unit test, as well as manual inspection of platform-bootclasspath
Change-Id: Ie05d8125e19736d8b4b9ebafb70b88a0a40069d5
2023-09-28 13:21:21 +00:00
Anton Hansson
0e73f9ee6d Collect transitive source files for java modules
This new entry in the JavaInfoProvider lists all the transitive source
files contained within the library. That is, the source files of the
module and all its static dependencies.

Bug: 151360309
Test: unit test in java_go + some manual testing
Change-Id: I7fe3035b9e46774095c0e9196cd77fa1027adf6d
2023-09-28 13:20:49 +00:00
Maxim Siniavine
943dc1b6f4 Revert "Add flagged api hide conditional to droidstubs" am: 1180919dda am: 57639c5e65 am: 4a564b5bcd am: b1b05aea50 am: c18a909a93
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766347

Change-Id: I81e893d4fce8c1bde51f2ae66e299f79d4868a05
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 06:04:43 +00:00
Maxim Siniavine
4a564b5bcd Revert "Add flagged api hide conditional to droidstubs" am: 1180919dda am: 57639c5e65
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766347

Change-Id: Iba5f7b34be3865e9ac5a72c05a8113e2c0eff55d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 03:02:11 +00:00
Romain Jobredeaux
49c184262f Merge changes from topic "bazel_framework_res" into main am: 641b62b205 am: b0e61183f3 am: f1a3d7a303 am: ae9096771c am: bb53a4fc75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2720593

Change-Id: I9a9b31f51bced57a22db829cdf0dee58fd11f200
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 01:58:21 +00:00
Maxim Siniavine
57639c5e65 Revert "Add flagged api hide conditional to droidstubs" am: 1180919dda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766347

Change-Id: Iecdfb508043d33ed23479d4fe758980943b629d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 01:55:22 +00:00
Maxim Siniavine
4aa82a13db Merge changes from topic "revert-2755310-HIIDCMFNIU" into main
* changes:
  Revert "Add soong config variable Release_expose_flagged_api"
  Revert "Add flagged api hide conditional to droidstubs"
2023-09-28 01:08:44 +00:00
Maxim Siniavine
1180919dda Revert "Add flagged api hide conditional to droidstubs"
Revert submission 2755310

Reason for revert: Broken build b/302407753

Reverted changes: /q/submissionid:2755310

Change-Id: I56306fc3b7e5608d21dbefe18d6a886561599f40
2023-09-28 01:01:59 +00:00
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
Jihoon Kang
15ec654d53 Merge changes from topic "expose_flagged_api" into main am: af26c102b8 am: ff593197d9 am: daa3a1a2db am: 9ddde37234 am: c38c9e3f1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755310

Change-Id: I69422f68540212dbd178e469e2bf4bbb1931fb7e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 22:51:56 +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
Romain Jobredeaux
d5d7e2bc72 Merge "Do not convert android_library_import with no aars." into main am: 832e131725 am: 51cab22f4e am: 2682639f03 am: f1037ec0eb am: 8d9d976c0d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2760791

Change-Id: I039fd28954fbe6fa0b9900090d2d3fa29b6a9578
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 00:26:56 +00: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
Colin Cross
af4fc302a5 Merge "Shard srcjars when sharding javac compilation" into main am: b983ceac33 am: 9a21f40742 am: e693d617c2 am: 9932c623cb am: ea2a6d3715
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2762551

Change-Id: I0cad47c61dfb58ba2cb3df1d27a548ad0f7a6667
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 22:32:14 +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
Treehugger Robot
6320d21203 Merge "Improve optimize bp2build conditional." into main am: 8559872623 am: 6c49c4a1d5 am: 36b815461a am: d75588773b am: c264f981d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2762806

Change-Id: I419234a25d55240978ac0c6be7a0b4627ff956cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 20:40:09 +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