platform_build_soong/java
Paul Duffin 0038a8d374 Prevent non-app/non-test modules from statically including jacocoagent
(cherry picked from commit 3953153c9e)

Previously, the .impl library of java_sdk_library modules would end up
with the jacocoagent statically included. That is because their
Instrument flag was set to true when created by their parent. As that
was before the deps were added that meant that they ended up with a
static dependency on jacoagent (at least when UnbundledBuild() was
true).

That was not previously a problem because the .impl files were only
used at build time. However, a recent change to make updatable-media
statically include framework-media.impl (which statically included the
jacocoagent classes) broke the coverage build because the jacocoagent
classes are not in the permitted packages for the updatable-media.

When instrumenting the bootclasspath the jacocoagent library is added
to the art-bootclasspath-fragment.

The jacocoagent should only be statically included in apps, or test
apps. This change adds an extra flag to specify whether the module type
supports statically including the jacocoagent. This is set to true by
apps and test apps but not when the java_sdk_library creates the .impl
java_library preventing it from statically including jacocoagent.

Bug: 230967146
Bug: 229932396
Test: COVERAGE_MODULES=media \
      PRODUCT=mainline_modules_x86 \
      TARGET_BUILD_APPS=com.google.android.media \
      vendor/google/build/build_unbundled_coverage_mainline_module.sh
      # Fails without this change, passes with it.
Merged-In: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
Change-Id: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
2022-05-03 10:11:59 +00:00
..
config Replace DEX_FLAGS by flags for D8 and R8. 2022-04-25 11:17:07 +02:00
core-libraries Rename core-current-stubs-system-modules to be more consistent 2021-11-03 16:58:29 +00:00
aapt2.go
aar.go Document AARImportProperties fields 2022-04-13 02:12:37 +00:00
Android.bp Export provenance metadata for prebuilt APKs and APEXes. 2022-04-05 16:16:16 -07:00
android_manifest.go Fix error message formatting 2022-04-22 13:53:16 +00:00
android_resources.go Initial bp2build converter for android_app. 2021-12-07 09:41:49 -05:00
androidmk.go Add jni support to java_fuzz_host 2022-04-26 18:49:02 +00:00
androidmk_test.go
app.go Prevent non-app/non-test modules from statically including jacocoagent 2022-05-03 10:11:59 +00:00
app_builder.go
app_import.go Fix documentation for android_app_import 2022-04-13 21:40:23 +00:00
app_import_test.go Export provenance metadata for prebuilt APKs and APEXes. 2022-04-05 16:16:16 -07:00
app_set.go Install android_app_set modules in Soong 2021-11-17 19:55:33 -08:00
app_set_test.go Extract primary apk from apk set zip 2021-11-17 19:55:33 -08:00
app_test.go Don't panic if no certificates found 2022-04-11 11:50:34 -07:00
base.go Prevent non-app/non-test modules from statically including jacocoagent 2022-05-03 10:11:59 +00:00
boot_jars.go
bootclasspath.go Remove fallback code path for missing BCP fragments that is no longer 2021-09-16 00:55:53 +01:00
bootclasspath_fragment.go Make bootclasspath_fragment hidden API package checks exhaustive 2022-03-18 10:54:51 +00:00
bootclasspath_fragment_test.go Fix tests to use correct fixtures for configuring (Apex)BootJars. 2021-08-10 15:35:52 +01:00
builder.go Revert "Use kapt stubs for kotlin header jar for javac" 2022-04-06 07:04:09 +00:00
classpath_element.go
classpath_fragment.go Remove InstallBypassMake and ToMakePath 2021-12-15 15:22:53 -08:00
device_host_converter.go Add android_sdk_repo_host to build platform-tools&build-tools 2021-10-13 01:25:02 -07:00
device_host_converter_test.go
dex.go Limit JIT tier for D8 2022-04-21 18:24:52 +00:00
dex_test.go Don't pass static libs to r8 2022-03-18 20:48:27 +00:00
dexpreopt.go Remove obsolete dexpreopt config option UseArtImage. 2022-04-27 13:36:47 +01:00
dexpreopt_bootjars.go Remove obsolete dexpreopt config option UseArtImage. 2022-04-27 13:36:47 +01:00
dexpreopt_bootjars_test.go
dexpreopt_check.go Update dexpreopt_check to check all system server jars. 2021-12-21 12:51:36 +00:00
dexpreopt_config.go Pass --preloaded-classes to boot image compilation. 2022-03-15 14:28:38 +00:00
dexpreopt_test.go Revert^2 "Preopt APEX system server jars." 2021-09-16 06:25:26 +00:00
droiddoc.go Add AIDL enforce_permissions attribute 2022-02-24 10:15:27 +11:00
droiddoc_test.go
droidstubs.go Merge "Enable restat for sbox rules" 2022-04-05 22:49:10 +00:00
droidstubs_test.go Add new file name to output inputs/outputs of actions of modules into a new file when m json-module-graph is executed. 2022-01-28 13:52:50 +08:00
fuzz.go Add jni support to java_fuzz_host 2022-04-26 18:49:02 +00:00
fuzz_test.go Add jni support to java_fuzz_host 2022-04-26 18:49:02 +00:00
gen.go Add AIDL enforce_permissions attribute 2022-02-24 10:15:27 +11:00
genrule.go bp2build converts java_genrule and java_genrule_host 2022-01-21 17:50:40 +00:00
genrule_test.go bp2build converts java_genrule and java_genrule_host 2022-01-21 17:50:40 +00:00
hiddenapi.go hiddenapi: Prevent libraries for Q/R from include S+ flags. 2022-04-28 18:34:48 +01:00
hiddenapi_modular.go hiddenapi: Prevent libraries for Q/R from include S+ flags. 2022-04-28 18:34:48 +01:00
hiddenapi_monolithic.go Separate creation of signature patterns from overlap checking 2021-08-06 13:40:34 +01:00
hiddenapi_singleton.go
hiddenapi_singleton_test.go Propagate the dex jar path as an OptionalPath which is either valid or 2021-09-23 17:19:55 +01:00
jacoco.go
jacoco_test.go
java.go bp2build converts java_version property to javacopts attribute 2022-04-28 18:52:48 -04:00
java_resources.go
java_test.go Use turbine instead of kapt for kotlin annotation processors 2022-03-25 10:28:50 -07:00
jdeps.go Export Java library dependency information 2022-04-18 10:23:28 +08:00
jdeps_test.go
kotlin.go Add missing dependency on compose plugin in kapt rules 2022-05-02 14:00:50 -07:00
kotlin_test.go Add missing dependency on compose plugin in kapt rules 2022-05-02 14:00:50 -07:00
legacy_core_platform_api_usage.go Remove ethernet-service jar dependency. 2022-03-16 00:52:40 +00:00
lint.go Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings" 2022-04-29 09:49:16 +00:00
lint_defaults.txt Disable newapi check in defaults 2022-04-25 18:17:11 +00:00
lint_test.go make system server modules use filtered lint database 2021-07-05 16:57:34 +00:00
OWNERS Adding metalava team to OWNERS to be able to disable metalava checks that will break platform build. 2022-01-28 18:34:08 +00:00
platform_bootclasspath.go Propagate min and max sdk versions to classpaths.proto configs. 2021-12-01 17:58:41 +00:00
platform_bootclasspath_test.go
platform_compat_config.go Remove InstallBypassMake and ToMakePath 2021-12-15 15:22:53 -08:00
platform_compat_config_test.go
plugin.go emulate java_library static_deps with Bazel exports 2022-03-30 18:58:38 +00:00
plugin_test.go Replace android.BuildOs with Config.BuildOS 2021-07-20 12:46:48 -07:00
prebuilt_apis.go Add support for sdk extensions in prebuilt_apis 2022-02-21 16:43:43 +00:00
prebuilt_apis_test.go Add support for sdk extensions in prebuilt_apis 2022-02-21 16:43:43 +00:00
proto.go convert java proto libraries with bp2build 2022-02-15 21:04:59 +00:00
proto_test.go add support for java stream protos in protoDeps 2022-02-07 22:39:38 +00:00
robolectric.go Remove InstallBypassMake and ToMakePath 2021-12-15 15:22:53 -08:00
rro.go Add support for excluding libraries from class loader contexts 2022-02-07 14:57:53 +00:00
rro_test.go Remove InstallBypassMake and ToMakePath 2021-12-15 15:22:53 -08:00
sdk.go Revert^2: "Setting Java 11 as the default version" 2022-01-24 13:31:05 +00:00
sdk_library.go Merge "java_sdk_library_import: Delegate OutputFiles to impl library if needed" 2022-04-29 17:27:23 +00:00
sdk_library_external.go
sdk_library_test.go Pass shared library updatability attributes as strings 2022-02-11 17:59:36 +00:00
sdk_test.go Rename core-current-stubs-system-modules to be more consistent 2021-11-03 16:58:29 +00:00
support_libraries.go
system_modules.go Refactor SdkMemberType.AddDependencies() 2021-08-31 17:07:07 +01:00
system_modules_test.go
systemserver_classpath_fragment.go Dexpreopt standalone system server jars. 2021-12-20 15:07:26 +00:00
systemserver_classpath_fragment_test.go Add entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb 2021-11-30 10:51:10 +00:00
testing.go Move proguard test files to java package 2022-04-11 11:44:32 -07:00
tradefed.go