diff options
author | 2020-07-02 11:38:17 -0700 | |
---|---|---|
committer | 2020-09-17 18:57:03 -0700 | |
commit | d27e7b8e459b3ed89763c910bf97b40512cf5b40 (patch) | |
tree | b2fc7e5ee1d6187691c109c24c25ae63a2d59206 /android/singleton.go | |
parent | d1f898e70abf0e750ae351689a6291700ff8739c (diff) |
Add providers support
Propagate the providers methods from
https://github.com/google/blueprint/pull/309 to Soong.
Test: m checkbuild
Change-Id: Iad7a9023df4421cd01dbb0518be0e85382097481
Diffstat (limited to 'android/singleton.go')
-rw-r--r-- | android/singleton.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/android/singleton.go b/android/singleton.go index 2c51c6c48..9832378d5 100644 --- a/android/singleton.go +++ b/android/singleton.go @@ -29,6 +29,16 @@ type SingletonContext interface { ModuleType(module blueprint.Module) string BlueprintFile(module blueprint.Module) string + // ModuleProvider returns the value, if any, for the provider for a module. If the value for the + // provider was not set it returns the zero value of the type of the provider, which means the + // return value can always be type-asserted to the type of the provider. The return value should + // always be considered read-only. It panics if called before the appropriate mutator or + // GenerateBuildActions pass for the provider on the module. + ModuleProvider(module blueprint.Module, provider blueprint.ProviderKey) interface{} + + // ModuleHasProvider returns true if the provider for the given module has been set. + ModuleHasProvider(module blueprint.Module, provider blueprint.ProviderKey) bool + ModuleErrorf(module blueprint.Module, format string, args ...interface{}) Errorf(format string, args ...interface{}) Failed() bool |