Merge "Sanitize APEX module name properly." am: c2c2d4e716
am: 18a051adfd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1423412 Change-Id: I58d10eef190545b2a954efb76ef4fd7e1da24810
This commit is contained in:
@@ -573,10 +573,12 @@ func (compiler *baseCompiler) uniqueApexVariations() bool {
|
|||||||
return compiler.useApexNameMacro()
|
return compiler.useApexNameMacro()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var invalidDefineCharRegex = regexp.MustCompile("[^a-zA-Z0-9_]")
|
||||||
|
|
||||||
// makeDefineString transforms a name of an APEX module into a value to be used as value for C define
|
// makeDefineString transforms a name of an APEX module into a value to be used as value for C define
|
||||||
// For example, com.android.foo => COM_ANDROID_FOO
|
// For example, com.android.foo => COM_ANDROID_FOO
|
||||||
func makeDefineString(name string) string {
|
func makeDefineString(name string) string {
|
||||||
return strings.ReplaceAll(strings.ToUpper(name), ".", "_")
|
return invalidDefineCharRegex.ReplaceAllString(strings.ToUpper(name), "_")
|
||||||
}
|
}
|
||||||
|
|
||||||
var gnuToCReplacer = strings.NewReplacer("gnu", "c")
|
var gnuToCReplacer = strings.NewReplacer("gnu", "c")
|
||||||
|
Reference in New Issue
Block a user