Loading mk2rbc/mk2rbc.go +6 −0 Original line number Diff line number Diff line Loading @@ -542,6 +542,12 @@ func (ctx *parseContext) handleAssignment(a *mkparser.Assignment) []starlarkNode if strings.HasPrefix(name, "override ") { return []starlarkNode{ctx.newBadNode(a, "cannot handle override directive")} } if name == ".KATI_READONLY" { // Skip assignments to .KATI_READONLY. If it was in the output file, it // would be an error because it would be sorted before the definition of // the variable it's trying to make readonly. return []starlarkNode{} } // Soong configuration if strings.HasPrefix(name, soongNsPrefix) { Loading mk2rbc/mk2rbc_test.go +14 −0 Original line number Diff line number Diff line Loading @@ -1529,6 +1529,20 @@ def init(g, handle): cfg["PRODUCT_COPY_FILES"] += ("foo/bar/%s:%s/etc/%s" % (x, g.get("TARGET_COPY_OUT_VENDOR", ""), x)).split() if g.get("MY_OTHER_VAR", ""): cfg["PRODUCT_COPY_FILES"] += ("%s:foo/bar/%s" % (g.get("MY_OTHER_VAR", ""), x)).split() `, }, { desc: ".KATI_READONLY", mkname: "product.mk", in: ` MY_VAR := foo .KATI_READONLY := MY_VAR `, expected: `load("//build/make/core:product_config.rbc", "rblf") def init(g, handle): cfg = rblf.cfg(handle) g["MY_VAR"] = "foo" `, }, } Loading Loading
mk2rbc/mk2rbc.go +6 −0 Original line number Diff line number Diff line Loading @@ -542,6 +542,12 @@ func (ctx *parseContext) handleAssignment(a *mkparser.Assignment) []starlarkNode if strings.HasPrefix(name, "override ") { return []starlarkNode{ctx.newBadNode(a, "cannot handle override directive")} } if name == ".KATI_READONLY" { // Skip assignments to .KATI_READONLY. If it was in the output file, it // would be an error because it would be sorted before the definition of // the variable it's trying to make readonly. return []starlarkNode{} } // Soong configuration if strings.HasPrefix(name, soongNsPrefix) { Loading
mk2rbc/mk2rbc_test.go +14 −0 Original line number Diff line number Diff line Loading @@ -1529,6 +1529,20 @@ def init(g, handle): cfg["PRODUCT_COPY_FILES"] += ("foo/bar/%s:%s/etc/%s" % (x, g.get("TARGET_COPY_OUT_VENDOR", ""), x)).split() if g.get("MY_OTHER_VAR", ""): cfg["PRODUCT_COPY_FILES"] += ("%s:foo/bar/%s" % (g.get("MY_OTHER_VAR", ""), x)).split() `, }, { desc: ".KATI_READONLY", mkname: "product.mk", in: ` MY_VAR := foo .KATI_READONLY := MY_VAR `, expected: `load("//build/make/core:product_config.rbc", "rblf") def init(g, handle): cfg = rblf.cfg(handle) g["MY_VAR"] = "foo" `, }, } Loading