Have AndroidMk skip emitting LOCAL_MODULE_TAGS="optional"

Also somewhat consolidate the way in which properties are converted

Bug: 34671474
Test: make blueprint_tools

Change-Id: Idf0d6d63b8539ab6e514a6043d1f88836899864b
This commit is contained in:
Jeff Gaston
2017-02-01 14:47:30 -08:00
parent 0c3919e996
commit 4f2feeee50
3 changed files with 218 additions and 131 deletions

View File

@@ -233,28 +233,16 @@ func handleAssignment(file *bpFile, assignment *mkparser.Assignment, c *conditio
appendVariable := assignment.Type == "+="
var err error
if prop, ok := standardProperties[name]; ok {
var val bpparser.Expression
val, err = makeVariableToBlueprint(file, assignment.Value, prop.Type)
if err == nil {
err = setVariable(file, appendVariable, prefix, prop.string, val, true)
}
} else if prop, ok := rewriteProperties[name]; ok {
err = prop.f(file, prefix, assignment.Value, appendVariable)
} else if _, ok := deleteProperties[name]; ok {
return
if prop, ok := rewriteProperties[name]; ok {
err = prop(variableAssignmentContext{file, prefix, assignment.Value, appendVariable})
} else {
switch {
case name == "LOCAL_PATH":
// Nothing to do, except maybe avoid the "./" in paths?
case name == "LOCAL_ARM_MODE":
// This is a hack to get the LOCAL_ARM_MODE value inside
// of an arch: { arm: {} } block.
armModeAssign := assignment
armModeAssign.Name = mkparser.SimpleMakeString("LOCAL_ARM_MODE_HACK_arm", assignment.Name.Pos())
handleAssignment(file, armModeAssign, c)
case name == "LOCAL_ADDITIONAL_DEPENDENCIES":
// TODO: check for only .mk files?
case strings.HasPrefix(name, "LOCAL_"):
file.errorf(assignment, "unsupported assignment to %s", name)
return