platform_build_soong/android
Dan Willemsen 8328367c44 Add VendorConfig for board-level Soong plugin configuration
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 0fe7866897)
2018-04-17 10:34:23 -07:00
..
androidmk.go Make Config.ProductVariables private 2018-04-17 10:34:23 -07:00
api_levels.go Finalizing P SDK 2018-04-12 06:43:59 -07:00
arch.go Make Config.ProductVariables private 2018-04-17 10:34:23 -07:00
config.go Add VendorConfig for board-level Soong plugin configuration 2018-04-17 10:34:23 -07:00
config_test.go Add VendorConfig for board-level Soong plugin configuration 2018-04-17 10:34:23 -07:00
defaults.go Convert Visit*Deps from blueprint.Module to android.Module 2017-10-24 13:01:03 -07:00
defs.go Make binaries executable 2017-08-31 13:48:52 -07:00
env.go Make *Context.Config return a Config instead of a interface{} 2017-11-30 00:44:11 +00:00
expand.go genrule: expand $$ to $$ 2016-11-22 15:41:08 -08:00
expand_test.go genrule: expand $$ to $$ 2016-11-22 15:41:08 -08:00
hooks.go Replace ModuleContext.AConfig() with Config() 2017-11-30 00:44:18 +00:00
makevars.go Make Config.ProductVariables private 2018-04-17 10:34:23 -07:00
module.go Allow platform modules to link to vendor public libraries 2018-03-30 12:59:06 +09:00
mutator.go Move namespace mutator earlier to support defaults 2018-01-26 20:21:18 -08:00
namespace.go Fix module rename inside namespace 2018-04-16 16:06:53 -07:00
namespace_test.go Fix module rename inside namespace 2018-04-16 16:06:53 -07:00
neverallow.go Allow VNDK extensions under vendor or device 2018-03-16 17:45:42 +08:00
neverallow_test.go Allow VNDK extensions under vendor or device 2018-03-16 17:45:42 +08:00
onceper.go Add OncePer.Get() 2017-11-07 13:36:44 -08:00
package_ctx.go Switch PackageContext functions to take a ctx 2018-04-16 19:27:14 -07:00
paths.go Make Config.ProductVariables private 2018-04-17 10:34:23 -07:00
paths_test.go Propagate errors out of validatePath 2018-02-22 14:43:36 -08:00
prebuilt.go Add VisitDirectDepsWithTag 2018-01-02 18:23:43 -08:00
prebuilt_test.go Extract failIfErrored() to android/testing.go 2018-03-16 17:45:42 +08:00
proto.go Add proto.canonical_path_from_root 2018-02-22 16:48:35 -08:00
register.go Convert a missed Singleton 2017-11-30 00:42:49 +00:00
singleton.go Make SingletonContext.Rule take a blueprint.RuleParams 2017-12-12 11:12:32 -08:00
testing.go Add unit tests for android/neverallow.go 2018-03-16 17:45:42 +08:00
util.go RemoveFromList() should remove all matches 2018-03-16 17:45:34 +08:00
util_test.go RemoveFromList() should remove all matches 2018-03-16 17:45:34 +08:00
variable.go Add VendorConfig for board-level Soong plugin configuration 2018-04-17 10:34:23 -07:00
variable_test.go Support %s in product variable properties 2017-05-05 18:22:30 -07:00
writedocs.go Allow Soong to generate its own build documentation 2017-12-12 11:12:32 -08:00