Include TARGET_RELEASE in soong metrics
While we explicitly do not tell the build engine the value of
TARGET_RELEASE, we can include it in the build metrics.
Bug: None
Test: Manual
Change-Id: I92e4b21b8c93e1039d405d29eaebfa3b89a57103
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index e0b2c08..b592f11 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -137,6 +137,12 @@
}
}
if ctx.Metrics != nil {
+ // Also include TARGET_RELEASE in the metrics. Do this first
+ // so that it gets overwritten if dumpvars ever spits it out.
+ if release, found := os.LookupEnv("TARGET_RELEASE"); found {
+ ctx.Metrics.SetMetadataMetrics(
+ map[string]string{"TARGET_RELEASE": release})
+ }
ctx.Metrics.SetMetadataMetrics(ret)
}