Create a new product variable to gate blueprint files
Users can use this feature by
1. Setting PRODUCT_INCLUDE_TAGS += <val> in their product mk files
2. Set
```
blueprint_packge_includes {
match_al: ["<val>"],
}
other_module_type {name: foo}
other_module_type {name: bar}
```
bar and foo will be included if and only if <val> is set
Test: Unit tests in blueprint
Test: TH
Change-Id: I32eed4e3b5ac47fb565c62d13d8881fa984c86f4
diff --git a/android/config.go b/android/config.go
index 4a64b5b..9d9ab30 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1111,6 +1111,10 @@
return append([]string(nil), c.productVariables.NamespacesToExport...)
}
+func (c *config) IncludeTags() []string {
+ return c.productVariables.IncludeTags
+}
+
func (c *config) HostStaticBinaries() bool {
return Bool(c.productVariables.HostStaticBinaries)
}
diff --git a/android/register.go b/android/register.go
index 6c69cc5..6cfc205 100644
--- a/android/register.go
+++ b/android/register.go
@@ -161,6 +161,7 @@
func NewContext(config Config) *Context {
ctx := &Context{blueprint.NewContext(), config}
ctx.SetSrcDir(absSrcDir)
+ ctx.AddIncludeTags(config.IncludeTags()...)
return ctx
}
diff --git a/android/variable.go b/android/variable.go
index 28f22c9..9725895 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -452,6 +452,8 @@
GenerateAidlNdkPlatformBackend bool `json:",omitempty"`
IgnorePrefer32OnDevice bool `json:",omitempty"`
+
+ IncludeTags []string `json:",omitempty"`
}
func boolPtr(v bool) *bool {