platform_build_soong/java
Paul Duffin f9b1da0fcb Dedup registration code for module types and singletons
The registration of module types and singletons is duplicated between
init() functions that register them for use in the build runtime and
test context creation code that registers them for testing.

This is a proof of concept for a mechanism that will allow the code
to be shared. It defines a RegistrationContext interface that is
implemented by both the TestContext and the new initRegistrationContext
type. An instance of the the latter is available through the
InitRegistrationContext variable.

The intent is that the registration of the module types and singleton
types will be extracted from the init() function into a separate
function that takes a RegistrationContext parameter. That method is
called from init() passing in the InitRegistrationContext and from a
test passing in the TestContext. Something like this:

  func init() {
    RegisterBuildComponents(android.InitRegistrationContext)
  }

  func RegisterBuildComponents(ctx android.RegistrationContext) {
    ctx.RegisterModuleType(....)
    ....
  }

A test would do something like this:

  ctx := android.NewTestContext()
  RegisterBuildComponents(ctx)

Test: m nothing
Change-Id: I97173cabb6d6cf7ce98fdb5f73418438b1997b35
2019-12-19 10:09:53 +00:00
..
config Enable covergae for ike.jar which will be in mainline module IPsec(IKE) 2019-12-17 15:23:38 -08:00
OWNERS Add ART folks to owner of dexpreopt related file. 2019-04-30 15:33:49 +01:00
aapt2.go Move sharding functions for reuse 2019-09-29 23:26:37 -07:00
aar.go Dedup registration code for module types and singletons 2019-12-19 10:09:53 +00:00
android_manifest.go Touch up manifest if there's no source code. 2019-06-03 10:51:42 -07:00
android_resources.go Separate device and product overlays 2019-03-21 11:25:46 +00:00
androidmk.go hostdex:true modules are available for platform 2019-12-16 15:19:13 +09:00
androidmk_test.go AndroidMk for the hostdex library has separate AndroidMkEntries 2019-12-11 17:27:07 +09:00
app.go Dedup registration code for module types and singletons 2019-12-19 10:09:53 +00:00
app_builder.go Reland "Also package recursive jni_libs deps of android_apps as well as direct deps." with bug fix. 2019-12-17 16:55:20 -08:00
app_test.go Merge "Reland "Also package recursive jni_libs deps of android_apps as well as direct deps." with bug fix." 2019-12-18 23:29:58 +00:00
builder.go Fix turbine classpath arguments 2019-11-07 02:05:06 +00:00
device_host_converter.go Add exported_plugins to java.Library. 2019-11-26 19:05:26 +00:00
device_host_converter_test.go Add method to determine variations from a Target 2019-10-16 14:52:30 -07:00
dex.go Remove passing -forceprocessing flag to R8 2019-11-27 12:40:07 +01:00
dexpreopt.go Use boot image extension for framework libraries. 2019-12-03 13:59:25 +00:00
dexpreopt_bootjars.go Revert "Use boot image extension for framework libraries." 2019-12-11 18:29:19 +00:00
dexpreopt_bootjars_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
dexpreopt_config.go Revert "Use boot image extension for framework libraries." 2019-12-11 18:29:19 +00:00
dexpreopt_test.go Add a rule about platform_apis 2019-07-29 20:48:30 +09:00
droiddoc.go Decouple addition of new sdk member types from sdk code 2019-12-13 20:07:33 +00:00
gen.go Shard aidl compiles into srcjars 2019-10-04 14:00:36 -07:00
genrule.go Add module type docs to the java package 2019-02-13 18:39:40 +00:00
hiddenapi.go Improve hiddenapi processing so it does not require white list 2019-02-28 16:13:20 +00:00
hiddenapi_singleton.go Revert submission 1194828-revert-1191937-art_apex_available-DWXQGTKMAR 2019-12-19 02:11:10 +00:00
jacoco.go Tune JVM, print full diagnostics on crash. 2019-06-11 13:30:13 -07:00
jacoco_test.go Change syntax for jacoco filter wildcard params. 2018-01-29 12:46:26 -08:00
java.go Dedup registration code for module types and singletons 2019-12-19 10:09:53 +00:00
java_resources.go Track sources for srcjars across modules 2019-05-06 14:22:26 -07:00
java_test.go Dedup registration code for module types and singletons 2019-12-19 10:09:53 +00:00
jdeps.go AIDEGen: Collect the srcjar into out/soong/module_bp_java_deps.json 2019-05-27 11:34:10 +00:00
jdeps_test.go jarjar_rules: accept file-group 2019-01-23 18:05:18 +00:00
kotlin.go Fix turbine classpath arguments 2019-11-07 02:05:06 +00:00
kotlin_test.go Java test code clean-up 2019-07-17 11:15:09 -07:00
platform_compat_config.go Merge multiple compat_config.xml's. 2019-12-18 16:34:04 +00:00
plugin.go Replace annotation_processors with plugins 2019-01-23 20:17:51 +00:00
plugin_test.go Java test code clean-up 2019-07-17 11:15:09 -07:00
prebuilt_apis.go Make CreateModule take an android.ModuleFactory 2019-09-26 17:19:26 +00:00
proto.go Default to compiling lite protos 2019-10-26 20:35:13 +00:00
robolectric.go AndroidMkEntries() returns multiple AndroidMkEntries structs 2019-12-11 17:25:27 +09:00
sdk.go Use java language 1.9 for sdk_version: "current" 2019-10-29 13:35:39 -07:00
sdk_library.go AndroidMkEntries() returns multiple AndroidMkEntries structs 2019-12-11 17:25:27 +09:00
sdk_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
support_libraries.go Allow other module types in androidx 2019-07-22 13:18:48 -07:00
sysprop.go Create public stub for platform's sysprop_library 2019-12-19 09:35:23 +09:00
system_modules.go Add experimental option to use OpenJDK 11 toolchain. 2019-10-09 18:38:14 +01:00
testing.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
tradefed.go Add tradefed_java_library_host 2019-10-18 15:14:15 -07:00