platform_build_soong/java
Paul Duffin 60264a0b99 Improve realism of boot jar tests
Boot jars, updatable boot jars and art apex jars are part of two
separate but related configuration objects, the main Config struct
(actually the nested productVariables struct) and the dexpreopt
specific GlobalConfig. The fields in both are initialized from the same
data in the make config files but handled separately.

Previously each test that used one of the configuration objects would
generally just initialize the one it used. That would make the test
sensitive to the specific configuration object that was used. A
refactoring that change the code from using one configuration object to
the other would cause the test to fail.

Also, some tests would inadvertently create invalid configurations by
setting ArtApexJars without also setting BootJars. While the ability to
create invalid configurations is useful (and there are some tests that
exist to verify the behavior in that case) most tests should not be
using them.

This change simplifies the configuration of the tests and improves
their realism by:
1. Providing a new FixtureConfigureBootJars method that takes a set of
   boot jars and sets ArtApexJars, and BootJars in the
   dexpreopt.GlobalConfig and BootJars in the product variables too.
2. Providing a new FixtureConfigureUpdatableBootJars method that takes
   a set of boot jars and sets UpdatableBootJars in both the
   dexpreopt.GlobalConfig and productVariables.
3. Migrating existing tests to use these new methods.

Some tests still use the dexpreopt.FixtureSet...Jars() methods directly,
generally to create invalid configurations.

Bug: 177892522
Test: m nothing
Change-Id: I4d8f0b9762cfcc7ae6383bef08563d7c3fa13955
2021-04-13 14:48:34 +01:00
..
config Silence kotlinc JDK9 warnings 2021-03-31 13:17:42 -07:00
aapt2.go Improve comments in java/aapt2.go 2020-11-30 14:16:02 -08:00
aar.go Move java.sdkSpec to the android package 2021-04-03 08:25:12 +09:00
Android.bp Introduce classpath_fragment.go. 2021-04-13 08:58:18 +01:00
android_manifest.go SdkSpec = Scope + ApiLevel 2021-04-05 09:32:06 +09:00
android_resources.go Add preparer for overlay pre-singleton registration 2021-03-22 22:09:53 +00:00
androidmk.go Move java.sdkSpec to the android package 2021-04-03 08:25:12 +09:00
androidmk_test.go Remove javaFixtureFactory 2021-03-24 01:07:12 +00:00
app.go Merge "Set the usesNonSdk manifest attribute whan targeting module SDKs." 2021-04-06 18:25:12 +00:00
app_builder.go Move android package on top of remotexec 2021-03-18 16:17:34 -07:00
app_import.go Move java.sdkSpec to the android package 2021-04-03 08:25:12 +09:00
app_import_test.go Remove uses of buildDir from java/app_import_test.go 2021-03-24 00:01:15 +00:00
app_set.go Break up app.go. 2020-12-21 12:31:51 -08:00
app_set_test.go Remove uses of buildDir from java/app_set_test.go 2021-03-24 00:01:15 +00:00
app_test.go Remove extraneous calls to TestingBuildParams.RelativeToTop() 2021-03-30 20:03:22 +01:00
base.go SdkSpec = Scope + ApiLevel 2021-04-05 09:32:06 +09:00
boot_image.go Add the transitive dependencies of boot_image to apex 2021-03-29 17:15:29 +01:00
boot_image_test.go Add contents property to boot_image (and prebuilt_boot_image) 2021-03-29 17:15:27 +01:00
boot_jars.go Add IsModulePreferred 2021-04-06 21:18:34 +01:00
builder.go Support multiple rsp files in REParams 2021-03-25 11:06:45 -07:00
classpath_fragment.go Introduce classpath_fragment.go. 2021-04-13 08:58:18 +01:00
device_host_converter.go Clear remains of java.Dependency interface. 2021-03-05 14:57:51 +00:00
device_host_converter_test.go
dex.go SdkSpec = Scope + ApiLevel 2021-04-05 09:32:06 +09:00
dexpreopt.go Allow using updatable boot jars in dexpreopt (but don't use them yet). 2021-03-24 11:16:11 +00:00
dexpreopt_bootjars.go Merge "Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go." 2021-03-25 17:25:44 +00:00
dexpreopt_bootjars_test.go Remove javaFixtureFactory 2021-03-24 01:07:12 +00:00
dexpreopt_config.go Allow using updatable boot jars in dexpreopt (but don't use them yet). 2021-03-24 11:16:11 +00:00
dexpreopt_test.go Write module dexpreopt.config for Make. 2021-01-28 06:29:13 +00:00
droiddoc.go Merge "Remove support for unsandboxed metalava" 2021-04-05 23:23:00 +00:00
droiddoc_test.go Remove extraneous calls to TestingBuildParams.RelativeToTop() 2021-03-30 20:03:22 +01:00
droidstubs.go Merge "Remove support for unsandboxed metalava" 2021-04-05 23:23:00 +00:00
droidstubs_test.go Remove support for unsandboxed metalava 2021-03-31 13:17:42 -07:00
gen.go Take Module implementations out of java/java.go. 2021-03-19 15:46:38 -07:00
genrule.go
hiddenapi.go Avoid hiddenapi ignoring prebuilt with missing dex implementation jar 2021-03-01 12:58:28 +00:00
hiddenapi_modular.go Move generation of global hidden API flags to platform_bootclasspath 2021-04-12 11:04:24 +01:00
hiddenapi_singleton.go Remove unused hiddenapi_flags module type 2021-04-13 00:23:55 +01:00
hiddenapi_singleton_test.go Improve realism of boot jar tests 2021-04-13 14:48:34 +01:00
jacoco.go
jacoco_test.go
java.go SdkSpec = Scope + ApiLevel 2021-04-05 09:32:06 +09:00
java_resources.go
java_test.go Merge "Remove unused java testing methods" 2021-03-31 21:41:42 +00:00
jdeps.go Convert java.Dependency to JavaInfo provider 2021-02-09 15:36:25 -08:00
jdeps_test.go
kotlin.go Silence kotlinc JDK9 warnings 2021-03-31 13:17:42 -07:00
kotlin_test.go Remove uses of buildDir from java/kotlin_test.go 2021-03-24 01:07:12 +00:00
legacy_core_platform_api_usage.go Merge "Add test suite to legacy core platform allowlist." 2021-03-16 23:02:39 +00:00
lint.go Merge "Update soong for new lint version" 2021-04-07 09:30:06 +00:00
lint_defaults.txt Update soong for new lint version 2021-04-06 17:49:19 +00:00
OWNERS
platform_bootclasspath.go Support UNSAFE_DISABLE_HIDDENAPI_FLAGS in platform_bootclasspath 2021-04-13 14:19:51 +01:00
platform_bootclasspath_test.go Improve realism of boot jar tests 2021-04-13 14:48:34 +01:00
platform_compat_config.go Add IsModulePreferred 2021-04-06 21:18:34 +01:00
platform_compat_config_test.go Add platform_compat_config to sdk 2021-03-22 19:13:40 +00:00
plugin.go Register java_plugin in PrepareForTestWithJavaBuildComponents 2021-03-24 00:01:15 +00:00
plugin_test.go
prebuilt_apis.go Merge "prebuilt_apis should create a java_system_modules_import" 2021-03-11 15:09:47 +00:00
proto.go Improve java.go readability. 2021-03-15 13:58:44 -07:00
robolectric.go Support robolectric prebuilts in android_robolectric_test 2021-03-05 19:22:30 +00:00
rro.go Move java.sdkSpec to the android package 2021-04-03 08:25:12 +09:00
rro_test.go Remove extraneous calls to TestingBuildParams.RelativeToTop() 2021-03-30 20:03:22 +01:00
sdk.go SdkSpec = Scope + ApiLevel 2021-04-05 09:32:06 +09:00
sdk_library.go Merge "Fix bug in sdk_library string matching" 2021-04-08 09:28:41 +00:00
sdk_library_external.go Remove global state from sysprop libraries 2021-02-26 16:28:12 -08:00
sdk_test.go Remove FixturePreparer.Extend() 2021-04-01 10:33:20 +01:00
support_libraries.go
system_modules.go Add PrebuiltNameFromSource 2021-04-06 21:20:58 +01:00
system_modules_test.go Remove varargs from RunTest(t *testing.T) 2021-03-31 16:03:59 +01:00
testing.go Improve realism of boot jar tests 2021-04-13 14:48:34 +01:00
tradefed.go