Commit Graph

7947 Commits

Author SHA1 Message Date
Jihoon Kang
e7c994e61b Disable full_api_surface_stubs for some java_api_library modules am: d30ac8a32a am: 7292538264
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769782

Change-Id: I22f37cf976310c0cdd4f94c468035355e4cc701b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-16 17:07:31 +00:00
Jihoon Kang
7292538264 Disable full_api_surface_stubs for some java_api_library modules am: d30ac8a32a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769782

Change-Id: I75cf340b882d0951f961a04d80f5da174311b049
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-16 16:38:52 +00:00
Jihoon Kang
bc98b4151d Merge changes from topic "stub_validation" into main
* changes:
  Add current api check as validation for from-text stub generation
  Disable full_api_surface_stubs for some java_api_library modules
2023-10-16 16:34:41 +00:00
Colin Cross
e331433dd9 Merge "Put shared library R.jar files in the classpath" into main am: 149f6f6f78 am: a43251d771 am: e88d5b1796 am: 0abb9e863b am: f4578a4787
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2787024

Change-Id: I22929b25c07d531d71ae9d077129b4d0a21341ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-13 20:53:38 +00:00
Colin Cross
e88d5b1796 Merge "Put shared library R.jar files in the classpath" into main am: 149f6f6f78 am: a43251d771
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2787024

Change-Id: I65bda887d0343e4501bc09a66f1d9fb523130ba2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-13 19:14:24 +00:00
Jihoon Kang
063ec003f9 Add current api check as validation for from-text stub generation
Currently, there is no build action ensuring that the API text files are
up to date, unless a user runs `m checkapi` or `m update-api`. This
means that the user must run `m update-api` after making a change that
modifies api surface(s), so that the API text file reflects the local
change. This adds additional layer of action to developers, and it is
not guaranteed that the developer will always run `m update-api` after
making an api surface-affecting changes.

To prevent such mistake, this change adds droidstub-level api check as
validation for from-text stub generation. With this change, the build
will fail if the API text file is not up to date and the user must run
`m update-api` when making api surface-affecting local changes.

The validation is done by adding all droidstubs modules associated with
the java_api_contributions passed to java_api_library via
`api_contributions` as dependency and setting the current api timestamp
files as the validations for the from-text stubs generating build rule.

The full api surface libraries will not run the validations to avoid
circular dependency. However, all java_sdk_library generated
java_api_library modules will run validations, mapped to the droidstubs
in the same api domaion.

If the user sets the environment variable `DISABLE_STUB_VALIDATION=true`, validation
actions are not run. Validation actions run by default.

Test: m nothing --build-from-text-stub and run ninja query to verify `check_current_api.timestamp`s are listed as validation \
      DISABLE_STUB_VALIDATION=true m nothing --build-from-text-stub and run ninja query to verify that validation actions are not added
Bug: 288624417
Change-Id: I329e6438fe8f3ac30d8c6a971d57853ed6b0d150
2023-10-13 18:24:41 +00:00
Colin Cross
149f6f6f78 Merge "Put shared library R.jar files in the classpath" into main 2023-10-13 18:08:04 +00:00
Liz Kammer
bcf8507f10 Merge "Handle java_resources as deps" into main am: b5c3b018d9 am: cd432e7a93 am: 1f92c64dcd am: ee6238a919 am: f6f9e4ddbd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2778708

Change-Id: If01f285e1b7c79f216f2850ed7f274e4ca8cc741
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 23:53:29 +00:00
Jihoon Kang
d30ac8a32a Disable full_api_surface_stubs for some java_api_library modules
java_api_library modules generated from java_sdk_library get
full_api_surface_stubs corresponding to the api surface that the module
contributes to. However, modules generated from java_sdk_library where
sdk_version is none should not depend on the full api surface stub jar.

Test: m --build-from-text-stub
Bug: 288624417
Change-Id: I7edda3e6a40f739e805e8719b8d366da765a6933
2023-10-12 23:05:27 +00:00
Colin Cross
8676c8cba5 Put shared library R.jar files in the classpath
When building with use_resource_processor: true R.jar files from
shared andoid_library dependencies need to be added to the classpath
so that the generated R classes can be referenced.

Bug: 294256649
Test: m DocumentsUIPerfTests
Change-Id: I30a6bddc3f378ecf58f142f94049e67ba33a47e3
2023-10-12 16:01:04 -07:00
Liz Kammer
cedc77e022 Merge "Change openjdk9 specific props in bp2build/Soong" into main am: c723757dd7 am: b29d829e6b am: 91d416a75c am: 61d7def32b am: 57b0309d6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2776469

Change-Id: Ia44bd2b671647f1da5a8b10abb2892e932615501
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 22:31:15 +00:00
Liz Kammer
1f92c64dcd Merge "Handle java_resources as deps" into main am: b5c3b018d9 am: cd432e7a93
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2778708

Change-Id: I0a25be6a79d438ea0203c550b7c5864e5fb58574
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 22:15:53 +00:00
Liz Kammer
b5c3b018d9 Merge "Handle java_resources as deps" into main 2023-10-12 21:10:37 +00:00
Liz Kammer
91d416a75c Merge "Change openjdk9 specific props in bp2build/Soong" into main am: c723757dd7 am: b29d829e6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2776469

Change-Id: I3b0ad4803f43854502ba88d543767f2160d313e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 20:51:55 +00:00
Liz Kammer
c723757dd7 Merge "Change openjdk9 specific props in bp2build/Soong" into main 2023-10-12 19:47:38 +00:00
Jihoon Kang
d3126e840f Merge changes from topic "enable-hidden-api" into main am: e100a884e3 am: 632dd0ca85 am: b37ad3e3fc am: 16f880079f am: 5cf2e5acc0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2617274

Change-Id: Ia511926efa8980a84c442f3225eadb7f45e95d35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 19:34:49 +00:00
Jihoon Kang
b37ad3e3fc Merge changes from topic "enable-hidden-api" into main am: e100a884e3 am: 632dd0ca85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2617274

Change-Id: I18d6dd99fc3b0255c149b5345123fa6faffd784c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 18:08:45 +00:00
Jihoon Kang
e100a884e3 Merge changes from topic "enable-hidden-api" into main
* changes:
  Enable hiddenapi check for from-text stub build
  Utilize module lib and test api superset module in hiddenapi
2023-10-12 17:33:35 +00:00
Liz Kammer
93b7e9545e Handle java_resources as deps
Test: CI && unit tests
Change-Id: I51f3c7d876c3cc25cb0459d933e1a510cfb5bf13
2023-10-12 09:57:06 -04:00
Liz Kammer
9f52f6ba60 Change openjdk9 specific props in bp2build/Soong
JDK17 is the default java version, adding these props conditionally
openjdk9 is no longer relevant

Test: CI
Change-Id: I5d80fd22f474cedf389d1e295620cfc17bc327a0
2023-10-12 09:57:04 -04:00
Ian Zerny
e28f87d654 Merge "Ignore dex files in input archives" into main am: 57beac1b76 am: 44c234ecf1 am: be0874053a am: 1d78fa32b2 am: ec28530f7f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2780987

Change-Id: I19cf849e22328b19e0e0ed607f81b0cd09652293
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 09:10:45 +00:00
Ian Zerny
be0874053a Merge "Ignore dex files in input archives" into main am: 57beac1b76 am: 44c234ecf1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2780987

Change-Id: I7408144c078f2eef7729bd53128e8e9b35104109
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 07:33:23 +00:00
Ian Zerny
57beac1b76 Merge "Ignore dex files in input archives" into main 2023-10-12 06:27:02 +00:00
Alix Espino
221b7393a0 Merge "Use an option struct in aapt.buildActions & manifestMerger" into main am: 37e64f9c91 am: a51e83ac06 am: aa0e12c22b am: 24520e5ab7 am: 2b38e79029
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769926

Change-Id: Ie9ef8ad2c3e7e93ac15a58e689f8eea11af1f78f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 05:33:33 +00:00
Alix Espino
aa0e12c22b Merge "Use an option struct in aapt.buildActions & manifestMerger" into main am: 37e64f9c91 am: a51e83ac06
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769926

Change-Id: I327c89db84f777efe1a2b84b35363501e0701830
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 03:57:08 +00:00
Alix Espino
37e64f9c91 Merge "Use an option struct in aapt.buildActions & manifestMerger" into main 2023-10-12 02:53:10 +00:00
Jihoon Kang
f2c4d490d9 Merge "Retain concrete overrides of abstract methods by default" into main am: c5be9361b6 am: 8f9d036314 am: cc599888db am: e7aea53468 am: 9dcf9c0655
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2781328

Change-Id: I1e78ad46b18bd5e622576a7dc7168bd9f514fc6f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 00:07:46 +00:00
Jihoon Kang
dec291e8ea Merge changes I804d3597,I6a25e2f6 into main am: faf7251c7b am: fbe7a9e772 am: 059362b5b4 am: 37a6b859d5 am: c1d2293205
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2779190

Change-Id: I9976f3d79310539ee99fd448a915b0f488322c08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-12 00:07:14 +00:00
Jihoon Kang
cc599888db Merge "Retain concrete overrides of abstract methods by default" into main am: c5be9361b6 am: 8f9d036314
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2781328

Change-Id: Iddf3556aa98fe3cc221f763cb7e30ff1f5dd45e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-11 21:26:06 +00:00
Jihoon Kang
059362b5b4 Merge changes I804d3597,I6a25e2f6 into main am: faf7251c7b am: fbe7a9e772
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2779190

Change-Id: I219a974ac1f39e58bc4a5c081f15c859064ffd72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-11 21:25:40 +00:00
Jihoon Kang
c5be9361b6 Merge "Retain concrete overrides of abstract methods by default" into main 2023-10-11 21:02:17 +00:00
Yu Liu
1d966c5cee Merge "Change java_test_host to support cov variant." into main am: 0bf0865f83 am: 8a5b48e26d am: b17766ab16 am: 6cbd6e62a0 am: c24a4fabb0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2776007

Change-Id: Ia44eb8c5e16b1d4d945cb9a91d50021262e99fa7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-11 20:21:44 +00:00
Yu Liu
b17766ab16 Merge "Change java_test_host to support cov variant." into main am: 0bf0865f83 am: 8a5b48e26d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2776007

Change-Id: I4d3db4d5ea0ed49da736e970a4b2ff587c6931fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-11 18:19:13 +00:00
Jihoon Kang
244d42a91b Utilize module lib and test api superset module in hiddenapi
Hiddenapi takes a single widest api scope stub dex jar as an input, as
the tool does not support handling duplicate classes passed as inputs.
A problem regarding this is that the test and module lib api surfaces do
not strictly have a subset/superset relationship, unlike other api
surfaces.

This has not become a problem for stubs generated from source
files as the stubs contain all methods in the source files, but became a
problem for stubs genereated from text files as the stubs only contain
the methods that are essential for compilation of the stubs and its
reverse dependencies, and there were cases where the hiddenapi flags are
not properly propagated to the subclasses.

To resolve this problem, a java_api_library module that provides the
union of the test and the module lib api surfaces was introcudes. Since
hiddenapi_modular currently defines the module lib api surface to be a
wider api scope over the test api scope, the new module can be passed as
input to hiddenapi over the module lib non updatable stub module to
resolve the problem.

Test: enable hiddenapi for from-text stub build && ENABLE_HIDDENAPI_FLAGS=true m --build-from-text-stub
Bug: 191644675
Bug: 275570206
Change-Id: I9a230ec5082c52ed866f29b0748814f2cf10279b
2023-10-11 17:06:23 +00:00
Jihoon Kang
f00200b6fb Add module dependency checking testing method
Currently in Soong testing suite, the only method for testing module
dependency is CheckModuleDependencies(...), which comapares for the
exact module dependencies. This change adds the method
CheckModuleDependency(...) which enables checking the dependency between
two modules, instead of comparing for all dependencies of an interested
module.

Test: m nothing
Bug: 288624417
Change-Id: I804d35979ddc24b0134671e326c1d37615ec4190
2023-10-11 16:18:45 +00:00
Jihoon Kang
8f83dcd18c Add droidstub modules for Soong java testing
Previously, only the essential java_api_library and
java_api_contribution modules were being added to the template bp file
for testing purpose. However, since the child change aosp/2640275
adds droidstubs that generates the java_api_contribution as the
dependency of the java_api_library modules, not adding the droidstubs
modules to the template bp file will lead to missing dependency errors
in Soong test cases that tests the from-text generation &
java_api_library functionality.

To prevent this, this change adds the droidstubs modules instead of the
auto generated java_api_contribution modules to the template bp file to
more closely align with the real life behavior.

Test: m nothing
Bug: 288624417
Change-Id: I6a25e2f6c5f1281e96eca15aa5eec7417635df3f
2023-10-11 16:17:55 +00:00
Yu Liu
0bf0865f83 Merge "Change java_test_host to support cov variant." into main 2023-10-11 16:15:40 +00:00
Jihoon Kang
752d87dfad Merge "Introduce system_modules property to java_api_library" into main am: 90c3f5fac4 am: 6df74f24b6 am: c1f2ef053a am: f058493441 am: 54e7b19224
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2774869

Change-Id: I6ec126bdb7556344fe1241c14664ca62c75065f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-11 01:35:59 +00:00
Zhi Dou
20078e9795 Add UnsupportedAppUsage to java_aconfig_library dependency am: 1b052b0078 am: 06f6aa131a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2776648

Change-Id: I9daf3f5063d1742f524e32234c8a00c332ff969e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-11 00:37:16 +00:00
Yu Liu
d8aa20062a Change java_test_host to support cov variant.
Bug: 279960392
Test: CI and m --skip-soong-tests TARGET_PRODUCT=aosp_x86_64 EMMA_INSTRUMENT=true CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="external/cronet" mts
Change-Id: I4489ed725aee6097e6e340f5f6d06ecaf1c64222
2023-10-10 16:00:32 -07:00
Jihoon Kang
c1f2ef053a Merge "Introduce system_modules property to java_api_library" into main am: 90c3f5fac4 am: 6df74f24b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2774869

Change-Id: I9306c7be5a60431b2ae326c638729feedd7bbf97
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-10 20:09:58 +00:00
Zhi Dou
1b052b0078 Add UnsupportedAppUsage to java_aconfig_library dependency
Generated flag requires UnsupportedAppUsage annotation to expose the
flag to CTS tests.

Bug: 301272559
Test: presubit
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5e2c96a93b4c16b224c090570a10697400a42c0a)
Merged-In: I90c87596ca80766ece429ddee1b45723b01d2760
Change-Id: I90c87596ca80766ece429ddee1b45723b01d2760
2023-10-10 19:36:00 +00:00
Jihoon Kang
90c3f5fac4 Merge "Introduce system_modules property to java_api_library" into main 2023-10-10 18:33:18 +00:00
Paul Duffin
629b9d287d Retain concrete overrides of abstract methods by default
Bug: 299366704
Test: m checkapi
Change-Id: I3d9fafefe90a98568c16d80c30e4d1d88a22c350
2023-10-10 17:50:25 +01:00
Alix
f7a1027c6b Use an option struct in aapt.buildActions & manifestMerger
Change-Id: Ia056ab321e1fd146ed0cdb98fc2d4455601f648c
Test: Treehugger
2023-10-10 14:31:03 +00:00
Ian Zerny
db2d35b8ac Ignore dex files in input archives
Bug: 303264288
Test: m checkbuild
Change-Id: Idce6a8226ca94b257b0ba7b3416b5b1bbffc3140
2023-10-10 14:35:14 +02:00
Jihoon Kang
4ec24870e0 Introduce system_modules property to java_api_library
System_modules property provides the jars passed as bootclasspath when
compiling the stubs in the java_api_library where its creating
java_sdk_library's sdk_version is none, as the jars will not be provided
from the full_surface_stub_libs but compiled by itself in the child
change.

The jar provided by the system_modules will also be passed to metalava
to resolve hierarchy coming from outer dependencies.

Test: m --build-from-text-stub
Bug: 288624417
Change-Id: I8f3b89efa24bceb070d7a37fae3c7334dd7f0868
2023-10-09 17:44:54 +00:00
Krzysztof Kosiński
2ba34e8f72 Clean up obsolete aliases for Truth. am: 5a55439d12 am: fd3d016a70 am: f0b5c69f64 am: 0ed7550fbe am: 04dc3cc6d8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2778191

Change-Id: I5d1c5e072d2a4050012916299961c07dd5e78242
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-08 06:03:51 +00:00
Krzysztof Kosiński
f0b5c69f64 Clean up obsolete aliases for Truth. am: 5a55439d12 am: fd3d016a70
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2778191

Change-Id: I2100953abf25bf9fb1cbc52530002d94612c5685
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-08 04:12:44 +00:00
Krzysztof Kosiński
5a55439d12 Clean up obsolete aliases for Truth.
Bug: 255714762
Test: presubmit
Change-Id: I2d7ef129bc8cad247d805ad392f05cd9d517b67e
2023-10-07 19:59:58 +00:00