platform_build_soong/sdk
Paul Duffin 255f18e584 Decouple addition of new sdk member types from sdk code
Previously, adding a new SdkMemberType would require adding a new
sdkMemberListProperty instance to the sdkMemberListProperties as well
as adding a new property into the sdkProperties struct. They are
potential sources of conflict and couple the sdk code with all the
packages that add members to it. This change switched to a
registration model that allows each package to register its sdk
member types decoupling them from the sdk code.

Adds an SdkPropertyName() method to SdkMemberType that specifies the
name of the property to use in the sdk/sdk_snapshot. Also provides
an SdkMemberTypeBase struct to be used by providers of SdkMemberType
implementations.

SdkMemberType instances are registered using the
RegisterSdkMemberType() func which sorts the registered instances
by their SdkPropertyName() to ensure the behavior is consistent and
not affected by order of registration.

When creating a new sdk module a dynamicSdkMemberTypes instance is
created that contains the following:

* A properties struct is created dynamically that contains a field for
  each registered SdkMemberType, corresponding to that type's
  SdkPropertyName().

* A list of sdkMemberListProperty instances is also created, one for
  each registered SdkMemberType.

The dynamicSdkMemberTypes instance is cached using a key that uniquely
identifies the set of registered types just in case new types are
registered after one has been created, e.g. by tests.

Bug: 142918168
Test: m checkbuild
Change-Id: I4bf2bf56a2a49025aa41454048bc1e8ccc6baca2
2019-12-13 20:07:33 +00:00
..
bp.go Add model to represent generated snapshot .bp file 2019-12-02 12:59:38 +00:00
cc_sdk_test.go Improve handling of generated include dirs 2019-12-13 09:59:48 +00:00
java_sdk_test.go Ensure prebuilt modules have same visibility as source modules 2019-12-09 13:32:28 +00:00
sdk.go Decouple addition of new sdk member types from sdk code 2019-12-13 20:07:33 +00:00
sdk_test.go Ensure prebuilt modules have same visibility as source modules 2019-12-09 13:32:28 +00:00
testing.go Added support for using static libraries in sdk snapshot 2019-12-12 11:37:39 +00:00
update.go Decouple addition of new sdk member types from sdk code 2019-12-13 20:07:33 +00:00