platform_build_soong/cc
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
..
config Revert "soong: upgrade Android platform to clang-r370808" 2019-12-09 19:16:08 +00:00
libbuildversion Add dist support to Soong 2018-11-19 15:26:14 -08:00
androidmk.go cc_fuzz: add "data" field 2019-12-05 14:45:51 -08:00
binary.go Split local and global cflags 2019-11-07 15:27:58 -08:00
builder.go Merge changes from topic "reorder-cflags" 2019-11-08 05:07:34 +00:00
cc.go Merge "Expose some factories for aidl_test.go" 2019-12-13 05:51:38 +00:00
cc_test.go AndroidMkEntries() returns multiple AndroidMkEntries structs 2019-12-11 17:25:27 +09:00
cflag_artifacts.go Split local and global cflags 2019-11-07 15:27:58 -08:00
check.go Forbid -Weverything 2019-11-12 15:55:03 -08:00
cmakelists.go Merge changes from topic "reorder-cflags" 2019-11-08 05:07:34 +00:00
compdb.go Split local and global cflags 2019-11-07 15:27:58 -08:00
compiler.go Fix generated headers of snapshot 2019-12-09 12:38:34 +09:00
compiler_test.go Expand ClangExtraExternalCflags to non-Google vendor projects 2019-11-11 13:24:39 -08:00
coverage.go Split local and global cflags 2019-11-07 15:27:58 -08:00
fuzz.go cc_fuzz: add "data" field 2019-12-05 14:45:51 -08:00
gen.go Performs same checks as aidl_interface.go before stripping leading "I". 2019-09-24 17:41:15 -07:00
gen_stub_libs.py Rename # vndk tag to # llndk 2019-11-13 05:50:27 +00:00
gen_test.go Split local and global cflags 2019-11-07 15:27:58 -08:00
genrule.go Move cc.imageMutator into the android package 2019-11-20 15:21:32 -08:00
genrule_test.go Move ImageMutator after archMutator 2019-12-06 12:37:14 -08:00
installer.go Merge "Remove old-style support for translated second architectures" 2019-10-07 20:48:07 +00:00
kernel_headers.go Change exportedDirs and exportedSystemDirs from []string to android.Paths 2019-10-25 09:52:08 +09:00
library.go Separate sdk membership support out of cc/library.go 2019-12-13 10:43:10 +00:00
library_sdk_member.go Decouple addition of new sdk member types from sdk code 2019-12-13 20:07:33 +00:00
library_test.go Split local and global cflags 2019-11-07 15:27:58 -08:00
linkable.go Allow cc.LinkabeInterfaces to request "" variants. 2019-11-21 13:25:08 -08:00
linker.go Split local and global cflags 2019-11-07 15:27:58 -08:00
llndk_library.go Rename # vndk tag to # llndk 2019-11-13 05:50:27 +00:00
lto.go Split local and global cflags 2019-11-07 15:27:58 -08:00
makevars.go Exclude dirs from binder interface whitelisting 2019-12-04 09:10:21 -08:00
ndk_headers.go Separate InstallPath from OutputPath 2019-10-03 10:07:53 -07:00
ndk_library.go Merge "Expose some factories for aidl_test.go" 2019-12-13 05:51:38 +00:00
ndk_prebuilt.go Expose some factories for aidl_test.go 2019-12-09 18:21:48 +09:00
ndk_sysroot.go Expose some factories for aidl_test.go 2019-12-09 18:21:48 +09:00
object.go Split local and global cflags 2019-11-07 15:27:58 -08:00
object_test.go Allow linker scripts when building objects. 2019-08-22 13:21:37 -07:00
pgo.go Split local and global cflags 2019-11-07 15:27:58 -08:00
prebuilt.go Dedup prebuilt cc library creation 2019-12-12 11:37:39 +00:00
prebuilt_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
proto.go Split local and global cflags 2019-11-07 15:27:58 -08:00
proto_test.go Fix tests with cc_binary_host on mac 2019-04-22 15:55:56 -07:00
pylintrc Don't warn for TODOish comments. 2016-08-01 14:36:22 -07:00
rs.go Move/dedupe some host path functions in package_ctx.go. 2019-12-09 22:04:21 +00:00
sabi.go Split local and global cflags 2019-11-07 15:27:58 -08:00
sanitize.go Merge "Add -instcombine-lower-dbg-declare to hwasan flags." 2019-12-03 02:19:08 +00:00
stl.go Split local and global cflags 2019-11-07 15:27:58 -08:00
strip.go Remove use_gnu_strip option 2019-09-13 12:18:47 -07:00
sysprop.go Implement sysprop_library API stability check 2019-08-23 06:28:34 +00:00
test.go Split local and global cflags 2019-11-07 15:27:58 -08:00
test_data_test.go Make TestContext.RegisterModuleType take an android.ModuleFactory 2019-11-25 10:59:44 -08:00
test_gen_stub_libs.py Rename # vndk tag to # llndk 2019-11-13 05:50:27 +00:00
testing.go Expose some factories for aidl_test.go 2019-12-09 18:21:48 +09:00
tidy.go Add support for clang-tidy -warnings-as-errors in Android.bp files 2019-03-26 20:47:08 +00:00
toolchain_library.go Repack libgcc.a to only include required objects 2019-10-24 16:34:54 -07:00
util.go Reorder local and global flags 2019-11-07 15:27:58 -08:00
vendor_public_library.go Split local and global cflags 2019-11-07 15:27:58 -08:00
vndk.go AndroidMkEntries() returns multiple AndroidMkEntries structs 2019-12-11 17:25:27 +09:00
vndk_prebuilt.go Merge "Change exportedDirs and exportedSystemDirs from []string to android.Paths" 2019-10-28 02:24:41 +00:00
xom.go Split local and global cflags 2019-11-07 15:27:58 -08:00