platform_build_soong/java
Paul Duffin 064b70c918 Export dex implementation jars from prebuilt_apex
Dexpreopt and boot jars package check all require access to dex
implementation jars created for java_library and java_sdk_library. They
were available when building from source but not when building from
prebuilts, even though they are embedded within the .apex files that
are referenced from prebuilt_apex.

This changes adds support to prebuilt_apex to export the dex
implementation jars and updates java_import to use those exported dex
implementation jars.

In a source build dexpreopt/boot jars package check access the apex (or
platform) specific variant of a java_library, e.g. core-oj, from which
it retrieves the dex implementation jar path.

After this change in a prebuilt build dexpreopt/boot jars package check
behave in the same way except in this case they retrieve the dex
implementation jar path from the apex (or platform) specific variant of
the java_import, e.g. core-oj.

The work to export files from a `.apex` file for use by other modules
is performed by a new `deapexer` module type. It is not used directly
in an `Android.bp` file but instead is created implicitly by
`prebuilt_apex`,

In order to do that this contains the following changes:
* Adds a new `dexapexer` module type to handle the exporting of files
  from the `.apex` file.
* Adds an exported_java_libs property to prebuilt_apex to specify the
  set of libraries whose dex implementation jars need exporting.
* Creates apex specific variants of the libraries listed in the
  exported_java_libs property.
* Adds the set of exported files to the ApexInfo to make them available
  to the apex specific variants.
* Prevents the prebuilt_apex variants from being merged together as
  they will not be compatible.
* Modifies java_import to use the exported file for variants of a
  prebuilt_apex.
* Adds a ninja rule to unpack (using deapexer) the contents of the
  prebuilt_apex's apex file, verify that the required files are present
  and make them available as outputs for other rules to use.
* Some minor refactorings to support these changes.
* Adds tests to cover prebuilt only, prebuilt with source preferred,
  and prebuilt preferred with source.

Test: m nothing
Bug: 171061220
Change-Id: Ic9bed81fb65b92f0d59f64c0bce168a9ed44cfac
2021-01-15 18:14:10 +00:00
..
config Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709) 2020-08-29 01:17:45 -07:00
aapt2.go Improve comments in java/aapt2.go 2020-11-30 14:16:02 -08:00
aar.go Merge changes I6a512209,I56437f26 2020-12-22 10:14:41 +00:00
Android.bp Break up app.go. 2020-12-21 12:31:51 -08: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 Remove AndroidMkExtraFootersFunc entries param. 2020-12-07 10:23:54 -08:00
androidmk_test.go Remove redundant setting of DistFiles by java.Library 2020-11-27 15:17:44 +00:00
app.go Merge "Remove obsolete class loader context API and update unit tests." 2021-01-08 17:00:56 +00:00
app_builder.go Soong: remove output file before running signapk 2020-11-25 23:07:23 +01:00
app_import.go Enforce <uses-library> checks for android_app and android_app_import. 2021-01-05 12:04:17 +00:00
app_import_test.go Enforce <uses-library> checks for android_app and android_app_import. 2021-01-05 12:04:17 +00: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_jars.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
builder.go Merge "Soong: remove output file before running SoongZip" 2020-12-09 08:05:06 +00:00
device_host_converter.go Remove restriction on exported plugins that generate APIs 2020-11-23 11:42:26 -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 Fix proguard_usage.zip with USE_RBE=true RBE_R8=true 2020-09-17 18:56:43 +00:00
dexpreopt.go Remove the return value from dexpreopt 2020-12-17 09:43:28 -08:00
dexpreopt_bootjars.go Export dex implementation jars from prebuilt_apex 2021-01-15 18:14:10 +00:00
dexpreopt_bootjars_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
dexpreopt_config.go Retry: Make ConfiguredJarList immutable 2020-10-27 17:37:20 +00:00
dexpreopt_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
droiddoc.go Remove Ignore_missing_latest_api 2020-12-31 10:44:38 +00:00
gen.go Use soong_zip -srcjar for proto and aidl srcjars 2020-12-23 17:13:16 -08:00
genrule.go
hiddenapi.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
hiddenapi_singleton.go Move temp blocklist APIs to max-sdk-r list. 2021-01-13 15:49:17 +00:00
hiddenapi_singleton_test.go Automatically set uncompress_dex for java_import. 2020-12-23 16:13:04 -08: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 Export dex implementation jars from prebuilt_apex 2021-01-15 18:14:10 +00:00
java_resources.go
java_test.go Add "aidl.flags:" property for cc_/java_ modules 2021-01-05 10:40:22 +09:00
jdeps.go Add soong cc and java deps to general-tests dist 2020-07-07 22:41:31 +00: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 Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -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
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 Add imports_compile_dex to prebuilt_apis 2020-09-02 09:27:35 -07:00
proto.go Use soong_zip -srcjar for proto and aidl srcjars 2020-12-23 17:13:16 -08:00
robolectric.go Remove AndroidMkExtraFootersFunc entries param. 2020-12-07 10:23:54 -08:00
rro.go Break up app.go. 2020-12-21 12:31:51 -08:00
rro_test.go Break up app.go. 2020-12-21 12:31:51 -08:00
sdk.go Remove unnecessary snake case variables. 2020-12-22 12:38:35 -08:00
sdk_library.go Remove Ignore_missing_latest_api 2020-12-31 10:44:38 +00: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
sysprop.go Add comments about sysprop_library 2020-11-24 14:13:31 +09:00
system_modules.go Revert^2 "Export soong license data to make." 2021-01-06 20:49:11 -08:00
testing.go Add attribute to disable last-api compat tracking 2020-12-21 17:25:30 +00:00
tradefed.go