aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-28 23:00:47 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-28 23:00:47 +0000
commitcef786fa78457bc0907650cc791d8f9fd1980504 (patch)
tree48c92e78197ffeb8426226c669b58c82b3c33d99
parente811bec991b3c2490a0da52c9c3229339c858899 (diff)
parent82747779baa334116d0337fb13edd1c0fdca5324 (diff)
downloadsoong-android13-qpr3-s4-release.tar.gz
Change-Id: I9b63cedbb3bbe6867ee700420d2d698c2f657d20
-rw-r--r--android/config.go4
-rw-r--r--android/register.go1
-rw-r--r--android/variable.go2
-rw-r--r--cmd/soong_build/main.go1
-rw-r--r--ui/build/config.go10
-rw-r--r--ui/build/dumpvars.go2
-rw-r--r--ui/build/soong.go1
7 files changed, 21 insertions, 0 deletions
diff --git a/android/config.go b/android/config.go
index 3c99659f9..cbf186e46 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1093,6 +1093,10 @@ func (c *config) ExportedNamespaces() []string {
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 c50583322..a29cfeaf1 100644
--- a/android/register.go
+++ b/android/register.go
@@ -160,6 +160,7 @@ type Context struct {
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 442068423..8d96e31cb 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -445,6 +445,8 @@ type productVariables struct {
GenerateAidlNdkPlatformBackend bool `json:",omitempty"`
ForceMultilibFirstOnDevice bool `json:",omitempty"`
+
+ IncludeTags []string `json:",omitempty"`
}
func boolPtr(v bool) *bool {
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index 4b3161b33..f1884a795 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -117,6 +117,7 @@ func newContext(configuration android.Config) *android.Context {
ctx.Register()
ctx.SetNameInterface(newNameResolver(configuration))
ctx.SetAllowMissingDependencies(configuration.AllowMissingDependencies())
+ ctx.AddIncludeTags(configuration.IncludeTags()...)
return ctx
}
diff --git a/ui/build/config.go b/ui/build/config.go
index e271bfca2..a6763214f 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -98,6 +98,8 @@ type configImpl struct {
emptyNinjaFile bool
metricsUploader string
+
+ includeTags []string
}
const srcDirFileCheck = "build/soong/root.bp"
@@ -1038,6 +1040,14 @@ func (c *configImpl) Parallel() int {
return c.parallel
}
+func (c *configImpl) GetIncludeTags() []string {
+ return c.includeTags
+}
+
+func (c *configImpl) SetIncludeTags(i []string) {
+ c.includeTags = i
+}
+
func (c *configImpl) HighmemParallel() int {
if i, ok := c.environ.GetInt("NINJA_HIGHMEM_NUM_JOBS"); ok {
return i
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index 285f1569b..cc796ce3f 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -139,6 +139,7 @@ func dumpMakeVars(ctx Context, config Config, goals, vars []string, write_soong_
var BannerVars = []string{
"PLATFORM_VERSION_CODENAME",
"PLATFORM_VERSION",
+ "PRODUCT_INCLUDE_TAGS",
"TARGET_PRODUCT",
"TARGET_BUILD_VARIANT",
"TARGET_BUILD_TYPE",
@@ -295,4 +296,5 @@ func runMakeProductConfig(ctx Context, config Config) {
config.SetBuildBrokenDupRules(makeVars["BUILD_BROKEN_DUP_RULES"] == "true")
config.SetBuildBrokenUsesNetwork(makeVars["BUILD_BROKEN_USES_NETWORK"] == "true")
config.SetBuildBrokenNinjaUsesEnvVars(strings.Fields(makeVars["BUILD_BROKEN_NINJA_USES_ENV_VARS"]))
+ config.SetIncludeTags(strings.Fields(makeVars["PRODUCT_INCLUDE_TAGS"]))
}
diff --git a/ui/build/soong.go b/ui/build/soong.go
index c7f22f946..a0ab1cc10 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -332,6 +332,7 @@ func bootstrapBlueprint(ctx Context, config Config) {
blueprintArgs.EmptyNinjaFile = false
blueprintCtx := blueprint.NewContext()
+ blueprintCtx.AddIncludeTags(config.GetIncludeTags()...)
blueprintCtx.SetIgnoreUnknownModuleTypes(true)
blueprintConfig := BlueprintConfig{
soongOutDir: config.SoongOutDir(),