Support "." in cpu and arch variant names

cortex-a53.a57 is a valid cpu variant, and needs to be translated to
cortex_a53_a57 when used as a field name.  Replace
dashToUnderscoreReplacer with a replacer that also converts "." to "_".

Change-Id: I1c496249b50d8e3a8d2bd830bc890f43ad9ee29e
This commit is contained in:
Colin Cross 2015-12-16 11:07:39 -08:00
parent 1ef47568f3
commit a716addb53
1 changed files with 3 additions and 3 deletions

View File

@ -581,7 +581,7 @@ func InitArchModule(m AndroidModule,
return m, allProperties
}
var dashToUnderscoreReplacer = strings.NewReplacer("-", "_")
var variantReplacer = strings.NewReplacer("-", "_", ".", "_")
func (a *AndroidModuleBase) appendProperties(ctx AndroidBottomUpMutatorContext,
dst, src interface{}, field, srcPrefix string) interface{} {
@ -660,7 +660,7 @@ func (a *AndroidModuleBase) setArchProperties(ctx AndroidBottomUpMutatorContext)
// key: value,
// },
// },
v := dashToUnderscoreReplacer.Replace(arch.ArchVariant)
v := variantReplacer.Replace(arch.ArchVariant)
if v != "" {
field := proptools.FieldNameForProperty(v)
prefix := "arch." + t.Name + "." + v
@ -673,7 +673,7 @@ func (a *AndroidModuleBase) setArchProperties(ctx AndroidBottomUpMutatorContext)
// key: value,
// },
// },
c := dashToUnderscoreReplacer.Replace(arch.CpuVariant)
c := variantReplacer.Replace(arch.CpuVariant)
if c != "" {
field := proptools.FieldNameForProperty(c)
prefix := "arch." + t.Name + "." + c