Support variables with dashes in their names

Bug: 221946551
Test: go test
Change-Id: I085fc35159c4f3afe53868fbc731fcaeac3a69a8
This commit is contained in:
Cole Faust
2022-02-28 16:05:01 -08:00
parent 812bfff3d8
commit 3c4fc99593
3 changed files with 26 additions and 12 deletions

View File

@@ -65,6 +65,10 @@ def init(g, handle):
PRODUCT_NAME := Pixel 3
PRODUCT_MODEL :=
local_var = foo
local-var-with-dashes := bar
$(warning local-var-with-dashes: $(local-var-with-dashes))
GLOBAL-VAR-WITH-DASHES := baz
$(warning GLOBAL-VAR-WITH-DASHES: $(GLOBAL-VAR-WITH-DASHES))
`,
expected: `load("//build/make/core:product_config.rbc", "rblf")
@@ -73,6 +77,10 @@ def init(g, handle):
cfg["PRODUCT_NAME"] = "Pixel 3"
cfg["PRODUCT_MODEL"] = ""
_local_var = "foo"
_local_var_with_dashes = "bar"
rblf.mkwarning("pixel3.mk", "local-var-with-dashes: %s" % _local_var_with_dashes)
g["GLOBAL-VAR-WITH-DASHES"] = "baz"
rblf.mkwarning("pixel3.mk", "GLOBAL-VAR-WITH-DASHES: %s" % g["GLOBAL-VAR-WITH-DASHES"])
`,
},
{