platform_build_soong/java
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
..
config Remove unnecessary flag for Kotlin compiles 2023-10-04 10:37:05 -04:00
core-libraries Add current api check as validation for from-text stub generation 2023-10-13 18:24:41 +00:00
aapt2.go Don't generate aapt2 srcjars when using resource processor 2023-08-02 21:50:38 -07:00
aar.go Merge "Always drop deps from android_library with no srcs" into main 2023-09-28 16:16:51 +00:00
aar_test.go copy JNI from AAR files to android_app APK 2022-08-02 16:12:06 -04:00
Android.bp Add test for manifest merger 2023-07-14 11:24:54 -07:00
android_manifest.go target_sdk_version replacement should respect REL branches 2023-04-28 16:23:53 +00:00
android_manifest_test.go Add test for manifest merger 2023-07-14 11:24:54 -07:00
android_resources.go
androidmk.go Update Headers_only to a bool pointer 2023-10-05 17:18:44 -04:00
androidmk_test.go Specify jnilib partition in Android-<target>.mk 2022-10-04 03:26:05 +00:00
app.go bp2build support for framework-res 2023-09-26 15:06:50 -04:00
app_builder.go Ensure extracted JNIs are stored properly in APKs 2023-07-31 21:16:18 +02:00
app_import.go Revert^2 "Only allow setting presigned without preprocessed on targetSdk < 30" 2023-09-07 05:31:32 +00:00
app_import_test.go Revert^2 "Only allow setting presigned without preprocessed on targetSdk < 30" 2023-09-07 05:31:32 +00:00
app_set.go Add skip-sdk-check to extract_apks 2023-03-21 08:13:25 -07:00
app_set_test.go Add skip-sdk-check to extract_apks 2023-03-21 08:13:25 -07:00
app_test.go android_app APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE 2023-09-05 21:38:16 +00:00
base.go Update Headers_only to a bool pointer 2023-10-05 17:18:44 -04:00
boot_jars.go
bootclasspath.go Refactor dexpreopt for boot jars to make it flexible to config changes. 2023-07-14 12:13:28 +01:00
bootclasspath_fragment.go Refactor dexpreopt for boot jars to make it flexible to config changes. 2023-07-14 12:13:28 +01:00
bootclasspath_fragment_test.go Fix some tests for dexpreopt and remove unnecessary tests. 2023-07-11 15:29:12 +01:00
builder.go Revert^2 "Only allow setting presigned without preprocessed on targetSdk < 30" 2023-09-07 05:31:32 +00:00
classpath_element.go Reformat build/soong for go 1.19 2022-08-17 10:43:13 -07:00
classpath_fragment.go Update max_sdk_version from SdkSpec to ApiLevel 2023-03-23 19:38:56 +00:00
device_host_converter.go Have ConvertWBp2build use Bp2buildMutatorContext 2023-09-20 14:49:35 +00:00
device_host_converter_test.go Strip META-INF/services from implementation jars when using as header jars 2023-07-19 21:48:11 +00:00
dex.go Don't create withres-withoutdex files for R8 2023-10-03 18:27:28 +00:00
dex_test.go export_proguard_spec for libs deps 2023-08-18 15:43:56 +00:00
dexpreopt.go Use per-app package list to avoid unnecessary dexpreopt. 2023-06-28 17:59:56 +01:00
dexpreopt_bootjars.go Add a Make variable that overrides configured jar locations. 2023-07-14 12:13:30 +01:00
dexpreopt_check.go Parallelize singleton execution 2023-05-19 20:31:32 +00:00
dexpreopt_config.go Add a Make variable to determine ART boot image jars for testing. 2023-07-14 12:13:30 +01:00
dexpreopt_config_test.go Refactor dexpreopt for boot jars to make it flexible to config changes. 2023-07-14 12:13:28 +01:00
dexpreopt_config_testing.go Add a Make variable to determine ART boot image jars for testing. 2023-07-14 12:13:30 +01:00
dexpreopt_test.go Prepare tests for dexpreopt changes. 2023-05-11 18:24:44 +01:00
droiddoc.go Support passing lint baseline to doclava 2023-10-03 12:15:19 +00:00
droiddoc_test.go
droidstubs.go Add current api check as validation for from-text stub generation 2023-10-13 18:24:41 +00:00
droidstubs_test.go Add current api check as validation for from-text stub generation 2023-10-13 18:24:41 +00:00
fuzz.go Merge "Add use_platform_libs to fuzz config" 2023-06-05 14:41:51 +00:00
fuzz_test.go Strip META-INF/services from implementation jars when using as header jars 2023-07-19 21:48:11 +00:00
gen.go AIDL source generation accounts for Bazel paths 2022-08-25 14:47:41 -04:00
generated_java_library.go Convert java_aconfig_library to bazel. 2023-10-02 15:04:19 -07:00
generated_java_library_test.go Convert java_aconfig_library to bazel. 2023-10-02 15:04:19 -07:00
genrule.go Reformat build/soong for go 1.19 2022-08-17 10:43:13 -07:00
genrule_test.go
hiddenapi.go Revert^2 "Only allow setting presigned without preprocessed on targetSdk < 30" 2023-09-07 05:31:32 +00:00
hiddenapi_modular.go Remove metalava --no-banner argument 2023-07-12 14:07:01 +02:00
hiddenapi_monolithic.go
hiddenapi_singleton.go Disable Hidden API Checks for ENG Builds 2023-07-30 13:57:10 +00:00
hiddenapi_singleton_test.go Prepare tests for dexpreopt changes. 2023-05-11 18:24:44 +01:00
jacoco.go add jacocoagent by default to Java modules 2022-09-09 16:50:38 -04:00
jacoco_test.go
java.go Add current api check as validation for from-text stub generation 2023-10-13 18:24:41 +00:00
java_resources.go
java_test.go Add current api check as validation for from-text stub generation 2023-10-13 18:24:41 +00:00
jdeps.go Parallelize singleton execution 2023-05-19 20:31:32 +00:00
jdeps_test.go
kotlin.go Enable restat for kapt stubs rules 2023-09-20 09:53:39 -07:00
kotlin_test.go transitive Java deps for r8 2023-01-20 17:05:14 -05:00
legacy_core_platform_api_usage.go Cleanup remaining android.JavaApiLibraryName() references 2023-06-15 19:42:34 +00:00
lint.go Add lint.suppress_exit_code attribute 2023-09-29 10:24:13 +10:00
lint_defaults.txt Downgrade newly failing lint checks 2023-08-03 00:57:41 +00:00
lint_test.go Give lint the correct api levels database for the current module 2023-02-28 21:18:17 -08:00
platform_bootclasspath.go Make the srcjar for bcp available in OutputFiles 2023-09-28 13:22:39 +00:00
platform_bootclasspath_test.go Add srcjar output for platform_bootclasspath 2023-09-28 13:21:21 +00:00
platform_compat_config.go Have ConvertWBp2build use Bp2buildMutatorContext 2023-09-20 14:49:35 +00:00
platform_compat_config_test.go
plugin.go Have ConvertWBp2build use Bp2buildMutatorContext 2023-09-20 14:49:35 +00:00
plugin_test.go
prebuilt_apis.go Support for incremetal platform prebuilt APIs 2023-08-25 18:03:44 +00:00
prebuilt_apis_test.go Support for incremetal platform prebuilt APIs 2023-08-25 18:03:44 +00:00
proto.go Add support for java_library proto plugin in bp2build 2023-10-05 12:53:23 -07:00
proto_test.go
resourceshrinker.go Suppress resourceshrinker stdout in soong 2023-06-16 23:12:33 +00:00
resourceshrinker_test.go Support testing for resource shrinking 2022-09-28 09:46:35 -07:00
robolectric.go Clean up obsolete aliases for Truth. 2023-10-07 19:59:58 +00:00
rro.go Update max_sdk_version from SdkSpec to ApiLevel 2023-03-23 19:38:56 +00:00
rro_test.go Allow overriding rro category in override_runtime_resource_overlay 2022-10-07 18:21:34 +00:00
sdk.go Cleanup remaining android.JavaApiLibraryName() references 2023-06-15 19:42:34 +00:00
sdk_library.go Add current api check as validation for from-text stub generation 2023-10-13 18:24:41 +00:00
sdk_library_external.go Reformat build/soong for go 1.19 2022-08-17 10:43:13 -07:00
sdk_library_test.go Create java_api_contribution_import from sdk_library_import 2023-09-18 19:33:28 +00:00
sdk_test.go
support_libraries.go
system_modules.go Stop module types being SdkAware 2022-12-12 17:33:06 +00:00
system_modules_test.go
systemserver_classpath_fragment.go Stop module types being SdkAware 2022-12-12 17:33:06 +00:00
systemserver_classpath_fragment_test.go
testing.go Add module dependency checking testing method 2023-10-11 16:18:45 +00:00
tradefed.go