Consolidate conversions of is-board-platform(2)
mk2rbc implements conversions for both is-board-platform(-in-list) and is-board-platform(-in-list)2. The conversions are not the same despite the functions being the same. Make them convert to the same thing. Bug: 201477826 Test: go test Change-Id: I688a2f6114e1688c713e42f0f9229cbc5ee6a917
This commit is contained in:
@@ -91,9 +91,9 @@ var knownFunctions = map[string]interface {
|
|||||||
"foreach": &foreachCallPaser{},
|
"foreach": &foreachCallPaser{},
|
||||||
"if": &ifCallParser{},
|
"if": &ifCallParser{},
|
||||||
"info": &makeControlFuncParser{name: baseName + ".mkinfo"},
|
"info": &makeControlFuncParser{name: baseName + ".mkinfo"},
|
||||||
"is-board-platform": &isBoardPlatformCallParser{},
|
"is-board-platform": &simpleCallParser{name: baseName + ".board_platform_is", returnType: starlarkTypeBool, addGlobals: true},
|
||||||
"is-board-platform2": &simpleCallParser{name: baseName + ".board_platform_is", returnType: starlarkTypeBool, addGlobals: true},
|
"is-board-platform2": &simpleCallParser{name: baseName + ".board_platform_is", returnType: starlarkTypeBool, addGlobals: true},
|
||||||
"is-board-platform-in-list": &isBoardPlatformInListCallParser{},
|
"is-board-platform-in-list": &simpleCallParser{name: baseName + ".board_platform_in", returnType: starlarkTypeBool, addGlobals: true},
|
||||||
"is-board-platform-in-list2": &simpleCallParser{name: baseName + ".board_platform_in", returnType: starlarkTypeBool, addGlobals: true},
|
"is-board-platform-in-list2": &simpleCallParser{name: baseName + ".board_platform_in", returnType: starlarkTypeBool, addGlobals: true},
|
||||||
"is-product-in-list": &isProductInListCallParser{},
|
"is-product-in-list": &isProductInListCallParser{},
|
||||||
"is-vendor-board-platform": &isVendorBoardPlatformCallParser{},
|
"is-vendor-board-platform": &isVendorBoardPlatformCallParser{},
|
||||||
@@ -1406,32 +1406,6 @@ func (p *myDirCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkp
|
|||||||
return &variableRefExpr{ctx.addVariable("LOCAL_PATH"), true}
|
return &variableRefExpr{ctx.addVariable("LOCAL_PATH"), true}
|
||||||
}
|
}
|
||||||
|
|
||||||
type isBoardPlatformCallParser struct{}
|
|
||||||
|
|
||||||
func (p *isBoardPlatformCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkparser.MakeString) starlarkExpr {
|
|
||||||
if args.Empty() {
|
|
||||||
return ctx.newBadExpr(node, "is-board-platform requires an argument")
|
|
||||||
}
|
|
||||||
return &eqExpr{
|
|
||||||
left: &variableRefExpr{ctx.addVariable("TARGET_BOARD_PLATFORM"), false},
|
|
||||||
right: ctx.parseMakeString(node, args),
|
|
||||||
isEq: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type isBoardPlatformInListCallParser struct{}
|
|
||||||
|
|
||||||
func (p *isBoardPlatformInListCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkparser.MakeString) starlarkExpr {
|
|
||||||
if args.Empty() {
|
|
||||||
return ctx.newBadExpr(node, "is-board-platform-in-list requires an argument")
|
|
||||||
}
|
|
||||||
return &inExpr{
|
|
||||||
expr: &variableRefExpr{ctx.addVariable("TARGET_BOARD_PLATFORM"), false},
|
|
||||||
list: maybeConvertToStringList(ctx.parseMakeString(node, args)),
|
|
||||||
isNot: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type isProductInListCallParser struct{}
|
type isProductInListCallParser struct{}
|
||||||
|
|
||||||
func (p *isProductInListCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkparser.MakeString) starlarkExpr {
|
func (p *isProductInListCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkparser.MakeString) starlarkExpr {
|
||||||
|
@@ -598,9 +598,9 @@ endif
|
|||||||
|
|
||||||
def init(g, handle):
|
def init(g, handle):
|
||||||
cfg = rblf.cfg(handle)
|
cfg = rblf.cfg(handle)
|
||||||
if g.get("TARGET_BOARD_PLATFORM", "") in ["msm8998"]:
|
if rblf.board_platform_in(g, "msm8998"):
|
||||||
pass
|
pass
|
||||||
elif g.get("TARGET_BOARD_PLATFORM", "") != "copper":
|
elif not rblf.board_platform_is(g, "copper"):
|
||||||
pass
|
pass
|
||||||
elif g.get("TARGET_BOARD_PLATFORM", "") not in g["QCOM_BOARD_PLATFORMS"]:
|
elif g.get("TARGET_BOARD_PLATFORM", "") not in g["QCOM_BOARD_PLATFORMS"]:
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user