Fix flavor matching in dotenv.gradle (#381)

`getCurrentFlavor` is returning flavor in lower case but `loadDotEnv` just compare flavor with the key in `envConfigFiles` directly

Example:
If the flavor named as `tempRelease`, `getCurrentFlavor` will return `temprelease` and the comparison will be failed
This commit is contained in:
booker-dragon 2020-08-04 20:34:57 +08:00 committed by GitHub
parent 876f581c06
commit 3ed79e4bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ def loadDotEnv(flavor = getCurrentFlavor()) {
} else if (project.hasProperty("envConfigFiles")) {
// use startsWith because sometimes the task is "generateDebugSources", so we want to match "debug"
project.ext.envConfigFiles.any { pair ->
if (flavor.startsWith(pair.key)) {
if (flavor.startsWith(pair.key.toLowerCase())) {
envFile = pair.value
return true
}