platform_build_soong/android
Paul Duffin 1387957727 Parameterize the sdk member processing
Extracts the type specific functionality into the SdkMemberType
interface which has to be implemented by each module type that can
be added as a member of the sdk. It provides functionality to add
the required dependencies for the module type, check to see if a
resolved module is the correct instance and build the snapshot.

The latter was previously part of SdkAware but was moved because
it has to be able to process multiple SdkAware variants so delegating
it to a single instance did not make sense.

The custom code for handling each member type specific property,
e.g. java_libs, has been replaced with common code that processes
a list of sdkMemberListProperty struct which associates the
property (name and getter) with the SdkMemberType and a special
DependencyTag which is passed to the SdkMemberType when it has to add
dependencies.

The DependencyTag contains a reference to the appropriate
sdkMemberListProperty which allows the resolved dependencies to be
grouped by type.

Previously, the dependency collection methods would ignore a module if
it was an unsupported type because they did not have a way of
determining which property it was initially listed in. That meant it
was possible to add say a droidstubs module to the java_libs property
(and because they had the same variants) it would work as if it was
added to the stubs_sources property. Or alternatively, a module of an
unsupported type could be added to any property and it would just be
ignored.

However, the DependencyTag provides information about which property
a resolved module was referenced in and so it can detect when the
resolved module is of the wrong type and report an error. That check
identified a bug in one of the tests where the sdk referenced a
java_import module (which is not allowed in an sdk) instead of a
java_library module (which is allowed). That test was fixed as part
of this.

A list of sdkMemberListProperty structs defines the member properties
supported by the sdk and are processed in order to ensure consistent
behaviour.

The resolved dependencies are grouped by type and each group is then
processed in defined order. Within each type dependencies are grouped
by name and encapsulated behind an SdkMember interface which includes
the name and the list of variants.

The Droidstubs and java.Library types can only support one variant and
will fail if given more.

The processing for the native_shared_libs property has been moved into
the cc/library.go file so the sdk package code should now have no type
specific information in it apart from what is if the list of
sdkMemberListProperty structs.

Bug: 143678475
Test: m conscrypt-module-sdk
Change-Id: I10203594d33dbf53441f655aff124f9ab3538d87
2019-12-06 12:16:59 +00:00
..
android_test.go Share buildDir for android/soong/android tests 2019-06-10 15:51:06 -07:00
androidmk.go Remove unused "product_services_specific" prop 2019-11-12 17:07:52 +09:00
androidmk_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
apex.go Make CreateVariations return []android.Module 2019-11-19 10:33:08 -08:00
api_levels.go Merge changes I9f8df94f,I2d7f5c56,I0ebb7381,Ieefcfc1a am: a6bf56d4be 2019-06-10 10:00:33 -07:00
arch.go Split out osMutator from archMutator 2019-10-16 15:27:23 -07:00
arch_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
config.go Enforce hidden apis usage in product(soong) 2019-11-06 19:42:42 +09:00
config_test.go Fix go vet issues 2018-07-22 21:18:45 -07:00
csuite_config.go Create C-Suite config module 2019-10-18 18:28:00 +00:00
csuite_config_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
defaults.go apex_available is defaultable 2019-12-02 13:48:33 +09:00
defaults_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
defs.go Fix package path of android/soong/android pctx 2019-04-10 16:49:27 -07:00
env.go Allow debugging with SOONG_DELVE=<listen addr> 2019-07-03 16:33:31 -07:00
expand.go Fix android.Expand and ninja escaping 2019-07-11 14:52:17 -07:00
expand_test.go Fix android.Expand and ninja escaping 2019-07-11 14:52:17 -07:00
filegroup.go Replace ctx.ExpandSources with android.PathsForModuleSrc 2019-03-20 19:36:13 +00:00
hooks.go Separate InstallPath from OutputPath 2019-10-03 10:07:53 -07:00
image.go Move cc.imageMutator into the android package 2019-11-20 15:21:32 -08:00
makevars.go Add GlobWithDeps to MakeVarsContext 2019-11-04 10:27:48 -08:00
module.go Add support for host sdk 2019-12-02 12:59:38 +00:00
module_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
mutator.go Make CreateVariations return []android.Module 2019-11-19 10:33:08 -08:00
mutator_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
namespace.go Give Blueprint modules access to all namespaces 2019-06-14 11:26:09 -07:00
namespace_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
neverallow.go Update paths for libnative{bridge,loader} 2019-11-06 13:39:46 +00:00
neverallow_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
notices.go Separate InstallPath from OutputPath 2019-10-03 10:07:53 -07:00
onceper.go Convert droidstubs to android.RuleBuilder 2019-07-18 14:28:14 -07:00
onceper_test.go Prevent hangs in OncePer when the callback panics 2019-05-14 18:40:13 +00:00
override_module.go Add override_apex module type 2019-11-19 16:49:36 +09:00
package.go Refactor visibility to support visibility on defaults modules 2019-07-25 11:31:42 +01:00
package_ctx.go Run non-RBE supported actions in the local pool when USE_RBE is set. 2019-11-05 22:57:35 +00:00
package_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
path_properties.go Dedup path properties across property structs 2019-07-16 09:52:23 -07:00
path_properties_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
paths.go Use boot image extension for framework libraries. 2019-12-03 13:59:25 +00:00
paths_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
prebuilt.go Merge "Delete prebuilt APEXes when installing source-built APEXes" am: a822256e15 2019-07-31 00:50:07 -07:00
prebuilt_etc.go Move cc.imageMutator into the android package 2019-11-20 15:21:32 -08:00
prebuilt_etc_test.go Merge changes I0dcc9c7b,I9bc40642 2019-11-25 22:30:17 +00:00
prebuilt_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
proto.go Add method to determine variations from a Target 2019-10-16 14:52:30 -07:00
register.go Support testing Rules in Modules and Rules and Builds in Singletons 2019-03-05 03:17:26 +00:00
rule_builder.go Rewrite depfile from sbox to stay reproducible 2019-08-29 14:47:40 -07:00
rule_builder_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
sdk.go Parameterize the sdk member processing 2019-12-06 12:16:59 +00:00
sh_binary.go sh_binary prefer 32bit when TARGET_PREFER_32_BIT 2019-11-19 13:45:18 +09:00
sh_binary_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
singleton.go Run non-RBE supported actions in the local pool when USE_RBE is set. 2019-11-05 22:57:35 +00:00
testing.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
util.go Merge "Soong generates vndk-related .libraries.txt files" 2019-11-01 01:57:50 +00:00
util_test.go Move sharding functions for reuse 2019-09-29 23:26:37 -07:00
variable.go Enforce hidden apis usage in product(soong) 2019-11-06 19:42:42 +09:00
variable_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
visibility.go Refactor visibility to support visibility on defaults modules 2019-07-25 11:31:42 +01:00
visibility_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
vts_config.go Create C-Suite config module 2019-10-18 18:28:00 +00:00
vts_config_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
writedocs.go Split up Soong build doc. 2019-02-20 15:43:06 -08:00