8328367c44
This allows Soong (Go) plugins to get custom configurations set in the
current product's BoardConfig.mk.
I'll have some more comprehensive documentation later, but the general
concept is that you'd have one namespace per plugin, defined in the
BoardConfig.mk (though they would work in the product.mk files too):
SOONG_CONFIG_NAMESPACES += myPlugin
Within that namespace you can set key-value pairs:
SOONG_CONFIG_myPlugin := key1 key2 ...
...
SOONG_CONFIG_myPlugin_key1 := value
...
SOONG_CONFIG_myPlugin_key2 := true
Then in your plugin, you can ask for your namespace:
vars := ctx.Config().VendorConfig("myPlugin")
And then use them:
str := vars.String("key1")
if vars.Bool("key2") { ... }
if vars.IsSet("key3") { ... }
Warning: It's not a good idea to fail on missing inputs, since an
android tree may contain plugins from multiple owners, and we may
configure your modules (but not build/install them) even if they're not
meant for the currently configured product.
Bug: 76168832
Test: define some variables, use them
Test: m blueprint_tools
Change-Id: I4c38f5a4344022c6f332de279d9bbef24502e741
Merged-In: I4c38f5a4344022c6f332de279d9bbef24502e741
(cherry picked from commit
|
||
---|---|---|
.. | ||
androidmk.go | ||
api_levels.go | ||
arch.go | ||
config.go | ||
config_test.go | ||
defaults.go | ||
defs.go | ||
env.go | ||
expand.go | ||
expand_test.go | ||
hooks.go | ||
makevars.go | ||
module.go | ||
mutator.go | ||
namespace.go | ||
namespace_test.go | ||
neverallow.go | ||
neverallow_test.go | ||
onceper.go | ||
package_ctx.go | ||
paths.go | ||
paths_test.go | ||
prebuilt.go | ||
prebuilt_test.go | ||
proto.go | ||
register.go | ||
singleton.go | ||
testing.go | ||
util.go | ||
util_test.go | ||
variable.go | ||
variable_test.go | ||
writedocs.go |