androidmk: clean up nested comparisons for local variable names

Change-Id: If84dbce05f1a28a562c8dba3eceedfe92b8d5ba5
This commit is contained in:
Colin Cross
2015-05-08 13:56:44 -07:00
committed by Colin Cross
parent f5f5dec662
commit 4e13f6d573

View File

@@ -236,24 +236,21 @@ func handleAssignment(file *bpFile, assignment mkparser.Assignment, c *condition
} else if _, ok := deleteProperties[name]; ok { } else if _, ok := deleteProperties[name]; ok {
return return
} else { } else {
if name == "LOCAL_PATH" { switch {
case name == "LOCAL_PATH":
// Nothing to do, except maybe avoid the "./" in paths? // Nothing to do, except maybe avoid the "./" in paths?
} else if name == "LOCAL_ARM_MODE" { case name == "LOCAL_ARM_MODE":
// This is a hack to get the LOCAL_ARM_MODE value inside // This is a hack to get the LOCAL_ARM_MODE value inside
// of an arch: { arm: {} } block. // of an arch: { arm: {} } block.
armModeAssign := assignment armModeAssign := assignment
armModeAssign.Name = mkparser.SimpleMakeString("LOCAL_ARM_MODE_HACK_arm", assignment.Name.Pos) armModeAssign.Name = mkparser.SimpleMakeString("LOCAL_ARM_MODE_HACK_arm", assignment.Name.Pos)
handleAssignment(file, armModeAssign, c) handleAssignment(file, armModeAssign, c)
} else if strings.HasPrefix(name, "LOCAL_") { case name == "LOCAL_ADDITIONAL_DEPENDENCIES":
//setVariable(file, assignment, name, bpparser.String, true) // TODO: check for only .mk files?
switch name { case strings.HasPrefix(name, "LOCAL_"):
case "LOCAL_ADDITIONAL_DEPENDENCIES": file.errorf(assignment, "unsupported assignment to %s", name)
// TODO: check for only .mk files? return
default: default:
file.errorf(assignment, "unsupported assignment to %s", name)
return
}
} else {
err = setVariable(file, assignment.Value, assignment.Type == "+=", name, bpparser.List, false, class, suffix) err = setVariable(file, assignment.Value, assignment.Type == "+=", name, bpparser.List, false, class, suffix)
} }
} }