1387957727
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 |
||
---|---|---|
.. | ||
android_test.go | ||
androidmk.go | ||
androidmk_test.go | ||
apex.go | ||
api_levels.go | ||
arch.go | ||
arch_test.go | ||
config.go | ||
config_test.go | ||
csuite_config.go | ||
csuite_config_test.go | ||
defaults.go | ||
defaults_test.go | ||
defs.go | ||
env.go | ||
expand.go | ||
expand_test.go | ||
filegroup.go | ||
hooks.go | ||
image.go | ||
makevars.go | ||
module.go | ||
module_test.go | ||
mutator.go | ||
mutator_test.go | ||
namespace.go | ||
namespace_test.go | ||
neverallow.go | ||
neverallow_test.go | ||
notices.go | ||
onceper.go | ||
onceper_test.go | ||
override_module.go | ||
package.go | ||
package_ctx.go | ||
package_test.go | ||
path_properties.go | ||
path_properties_test.go | ||
paths.go | ||
paths_test.go | ||
prebuilt.go | ||
prebuilt_etc.go | ||
prebuilt_etc_test.go | ||
prebuilt_test.go | ||
proto.go | ||
register.go | ||
rule_builder.go | ||
rule_builder_test.go | ||
sdk.go | ||
sh_binary.go | ||
sh_binary_test.go | ||
singleton.go | ||
testing.go | ||
util.go | ||
util_test.go | ||
variable.go | ||
variable_test.go | ||
visibility.go | ||
visibility_test.go | ||
vts_config.go | ||
vts_config_test.go | ||
writedocs.go |