Replace % with a double-escaped unicode value

Resource strings cannot include `%` as-is (cf. http://stackoverflow.com/questions/4414389/android-xml-percent-symbol).
This commit is contained in:
James G. Kim 2016-08-21 08:52:11 +09:00
parent ee3a094c28
commit 235cbf4028

View File

@ -16,8 +16,9 @@ readDotEnv()
android {
defaultConfig {
project.env.each { k, v ->
def escaped = v.replaceAll("%","\\\\u0025")
buildConfigField "String", k, "\"$v\""
resValue "string", k, "\"$v\""
resValue "string", k, "\"$escaped\""
}
}
}