platform_build_soong/java
Ulya Trafimovich 8c35fcf4d5 Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).

If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.

The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.

verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300

Test: Manually add some mismatch between the libraries in the Android.bp
      and Android.mk files for dexpreopted apps, build with
      RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
      fail and they are compiled with compiler-filter "extract".
      Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.

Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-22 15:41:03 +00:00
..
config Add LOCAL_LICENSE_KINDS to build/soong 2021-02-06 04:23:21 +00:00
aapt2.go Improve comments in java/aapt2.go 2020-11-30 14:16:02 -08:00
aar.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
Android.bp Add LOCAL_LICENSE_KINDS to build/soong 2021-02-06 04:23:21 +00:00
android_manifest.go Rename fields and methods to reflect class loader context changes. 2020-11-16 14:59:07 +00:00
android_resources.go Add dependency to list of asset files 2020-12-11 19:54:16 +00:00
androidmk.go Enable android_app_import to supply framework-res. 2021-02-05 14:30:46 -08:00
androidmk_test.go Supply LOCAL_SOONG_DEX_JAR for java_import with compile_dex. 2021-01-19 18:15:16 +00:00
app.go Add non-fatal mode for verify_uses_libraries check. 2021-02-22 15:41:03 +00:00
app_builder.go Soong: remove output file before running signapk 2020-11-25 23:07:23 +01:00
app_import.go Enable android_app_import to supply framework-res. 2021-02-05 14:30:46 -08:00
app_import_test.go Enable android_app_import to supply framework-res. 2021-02-05 14:30:46 -08:00
app_set.go Break up app.go. 2020-12-21 12:31:51 -08:00
app_set_test.go Break up app.go. 2020-12-21 12:31:51 -08:00
app_test.go Merge "Break up app.go." 2020-12-28 17:50:44 +00:00
boot_image.go Allow cross-cutting dependencies like licenses. 2021-02-05 19:59:11 -08:00
boot_image_test.go Add boot_image module type 2021-01-26 13:00:07 +00:00
boot_jars.go Fix boot jar handling when both source and prebuilt APEXes and modules 2021-01-28 20:09:24 +00:00
builder.go Turn missing jarjar output files into errors 2021-02-08 10:14:04 -08:00
device_host_converter.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
device_host_converter_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
dex.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
dexpreopt.go Add non-fatal mode for verify_uses_libraries check. 2021-02-22 15:41:03 +00:00
dexpreopt_bootjars.go Improve module filtering in hiddenapi stubFlagsRule() 2021-02-05 13:33:25 +00:00
dexpreopt_bootjars_test.go Add java.RegisterRequiredBuildComponentsForTest function 2021-01-21 11:47:32 +00:00
dexpreopt_config.go Move the logic to add jacocoagent in instrumentation builds to make. 2021-02-17 14:41:07 +00:00
dexpreopt_test.go Write module dexpreopt.config for Make. 2021-01-28 06:29:13 +00:00
droiddoc.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
gen.go Use soong_zip -srcjar for proto and aidl srcjars 2020-12-23 17:13:16 -08:00
genrule.go Dedup java genrule module type registration 2019-12-19 19:19:40 +00:00
hiddenapi.go Allow explicitly specified additional annotations for hiddenapi 2021-02-16 13:28:26 +00:00
hiddenapi_singleton.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
hiddenapi_singleton_test.go Allow explicitly specified additional annotations for hiddenapi 2021-02-16 13:28:26 +00:00
jacoco.go Use a default exclude filter for JaCoCo in Soong. 2020-07-08 19:29:10 +00:00
jacoco_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
java.go Merge changes from topic "mkboot" 2021-02-16 23:27:32 +00:00
java_resources.go Track sources for srcjars across modules 2019-05-06 14:22:26 -07:00
java_test.go Make dexpreopt tools available for all java tests 2021-01-25 19:15:19 +00:00
jdeps.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
jdeps_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
kotlin.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
kotlin_test.go Support extra checks for ErrorProne in a dedicated property 2020-11-19 14:20:12 -08:00
legacy_core_platform_api_usage.go Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709) 2020-08-29 01:17:45 -07:00
lint.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
lint_defaults.txt Add support for running Android lint on java and android modules. 2020-06-18 11:01:47 -07:00
OWNERS Add ART folks to owner of dexpreopt related file. 2019-04-30 15:33:49 +01:00
platform_compat_config.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
plugin.go Consolidate adding common java properties 2020-06-18 11:01:47 -07:00
plugin_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
prebuilt_apis.go Use genrule instead of filegroup for api files 2021-02-17 17:16:43 +00:00
proto.go bp2build: convert paths/module refs to Bazel label 2021-02-04 13:45:56 -05:00
robolectric.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
rro.go go/Android.bp: Clarify sdk_version documentation. 2021-01-28 21:55:37 +00:00
rro_test.go Break up app.go. 2020-12-21 12:31:51 -08:00
sdk.go Merge "Fix api_fingerprint.txt generation" 2021-02-15 11:31:37 +00:00
sdk_library.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
sdk_library_external.go Add java sdk library enforcement flag 2020-11-24 17:56:15 +09:00
sdk_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
support_libraries.go Allow other module types in androidx 2019-07-22 13:18:48 -07:00
sysprop.go Add comments about sysprop_library 2020-11-24 14:13:31 +09:00
system_modules.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
testing.go Refactor the hiddenAPI() method for reusability 2021-02-08 19:10:50 +00:00
tradefed.go Add tradefed_java_library_host 2019-10-18 15:14:15 -07:00