0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-25 12:45:12 +00:00

bumped up version and updated language getter

This commit is contained in:
X1nto 2021-02-23 19:33:23 +04:00
parent e9ff1bfd9d
commit b32ebe51a0

View file

@ -16,12 +16,12 @@ android {
applicationId = "com.vanced.manager" applicationId = "com.vanced.manager"
minSdkVersion(21) minSdkVersion(21)
targetSdkVersion(30) targetSdkVersion(30)
versionCode = 250 versionCode = 251
versionName = "2.5.0 (Weed)" versionName = "2.5.1 (Weed)"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
buildConfigField("String[]", "MANAGER_LANGUAGES", "{" + getLanguages() + "}") buildConfigField("String[]", "MANAGER_LANGUAGES", "{$languages}")
buildConfigField("Boolean", "ENABLE_CROWDIN_AUTH", "false") buildConfigField("Boolean", "ENABLE_CROWDIN_AUTH", "false")
buildConfigField("String", "CROWDIN_HASH", "\"${System.getenv("CROWDIN_HASH")}\"") buildConfigField("String", "CROWDIN_HASH", "\"${System.getenv("CROWDIN_HASH")}\"")
buildConfigField("String", "CROWDIN_CLIENT_ID", "\"${System.getenv("CROWDIN_CLIENT_ID")}\"") buildConfigField("String", "CROWDIN_CLIENT_ID", "\"${System.getenv("CROWDIN_CLIENT_ID")}\"")
@ -70,16 +70,17 @@ android {
} }
fun getLanguages(): String { val languages: String get() {
val langs = arrayListOf("en", "bn_BD", "bn_IN", "pa_IN", "pa_PK", "pt_BR", "pt_PT", "zh_CN", "zh_TW") val langs = arrayListOf("en", "bn_BD", "bn_IN", "pa_IN", "pa_PK", "pt_BR", "pt_PT", "zh_CN", "zh_TW")
val exceptions = arrayOf("bn", "pa", "pt", "zh") val exceptions = arrayOf("bn", "pa", "pt", "zh")
File("$projectDir/src/main/res").listFiles()?.forEach { dir -> File("$projectDir/src/main/res").listFiles()?.filter {
if (dir.name.startsWith("values-") && !dir.name.contains("v23")) { val name = it.name
val dirname = dir.name.substringAfter("-").substringBefore("-") name.startsWith("values-") && !name.contains("v23")
if (!exceptions.any { dirname == it }) { }?.forEach { dir ->
langs.add(dirname) val dirname = dir.name.substringAfter("-").substringBefore("-")
} if (!exceptions.any { dirname == it }) {
langs.add(dirname)
} }
} }
return langs.joinToString(", ") { "\"$it\"" } return langs.joinToString(", ") { "\"$it\"" }