Flag 'override' directives.
Bug: 201087531 Test: internal Change-Id: I2e08b126d769b1595172b04a3539e99b3e72cb2b
This commit is contained in:
@@ -540,6 +540,14 @@ func (ctx *parseContext) handleAssignment(a *mkparser.Assignment) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
name := a.Name.Strings[0]
|
name := a.Name.Strings[0]
|
||||||
|
// The `override` directive
|
||||||
|
// override FOO :=
|
||||||
|
// is parsed as an assignment to a variable named `override FOO`.
|
||||||
|
// There are very few places where `override` is used, just flag it.
|
||||||
|
if strings.HasPrefix(name, "override ") {
|
||||||
|
ctx.errorf(a, "cannot handle override directive")
|
||||||
|
}
|
||||||
|
|
||||||
// Soong configuration
|
// Soong configuration
|
||||||
if strings.HasPrefix(name, soongNsPrefix) {
|
if strings.HasPrefix(name, soongNsPrefix) {
|
||||||
ctx.handleSoongNsAssignment(strings.TrimPrefix(name, soongNsPrefix), a)
|
ctx.handleSoongNsAssignment(strings.TrimPrefix(name, soongNsPrefix), a)
|
||||||
|
@@ -1025,6 +1025,21 @@ load("//build/make/core:product_config.rbc", "rblf")
|
|||||||
def init(g, handle):
|
def init(g, handle):
|
||||||
cfg = rblf.cfg(handle)
|
cfg = rblf.cfg(handle)
|
||||||
rblf.warning("product.mk", "partially successful conversion")
|
rblf.warning("product.mk", "partially successful conversion")
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "Flag override",
|
||||||
|
mkname: "product.mk",
|
||||||
|
in: `
|
||||||
|
override FOO:=`,
|
||||||
|
expected: `# MK2RBC TRANSLATION ERROR: cannot handle override directive
|
||||||
|
# override FOO :=
|
||||||
|
load("//build/make/core:product_config.rbc", "rblf")
|
||||||
|
|
||||||
|
def init(g, handle):
|
||||||
|
cfg = rblf.cfg(handle)
|
||||||
|
g["override FOO"] = ""
|
||||||
|
rblf.warning("product.mk", "partially successful conversion")
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user