Elide empty variations

Don't add a "_" to the variant name if the variation name is empty.  For
example, when splitting a variant with name "foo" into variations "" and
"bar", the new variants would be named "foo" and "foo_bar" instead of
"foo_" and "foo_bar".

Change-Id: I82342d57e2a8e9f2d65a7d8d2872dcb7b3512899
This commit is contained in:
Colin Cross 2016-08-11 17:01:46 -07:00
parent 056963fe71
commit badc8817fa

View file

@ -1000,11 +1000,13 @@ func (c *Context) createVariations(origModule *moduleInfo, mutatorName string,
newModule.dependencyVariant = origModule.dependencyVariant.clone()
newModule.moduleProperties = newProperties
if variationName != "" {
if newModule.variantName == "" {
newModule.variantName = variationName
} else {
newModule.variantName += "_" + variationName
}
}
newModules = append(newModules, newModule)