Skip to content

Commit

Permalink
chore: Replace android.resourceConfigurations to android.androidResou…
Browse files Browse the repository at this point in the history
…rce.localFilters

Signed-off-by: Hu Shenghao <[email protected]>
  • Loading branch information
hushenghao committed Jan 15, 2025
1 parent 508a48d commit f3a36d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
@file:Suppress("UnstableApiUsage")// androidResources.localeFilters

plugins {
id("easter.egg.app")
}

android {
namespace = "com.dede.android_eggs"

defaultConfig {
applicationId = "com.dede.android_eggs"
versionCode = 58
versionName = "3.4.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

resourceConfigurations += listOf(
androidResources {
localeFilters += listOf(
"zh", "zh-rTW",
"ru", "uk-rUA",
"en", "it", "de", "fr", "nl-rNL", "hu-rHU",
Expand All @@ -20,11 +17,18 @@ android {
"ja-rJP", "ko-rKR", "vi-rVN", "th-rTH", "fil-rPH", "lo-rLA",
"ar-rSA", "cs-rCZ", "ta-rIN", "ro-rRO", "sv-rSE", "my-rMM",
)
}

defaultConfig {
applicationId = "com.dede.android_eggs"
versionCode = 58
versionName = "3.4.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

setProperty("archivesBaseName", "easter_eggs_${versionName}_${versionCode}")

// Language configuration only
buildConfigField("int", "LANGUAGE_RES", resourceConfigurations.size.toString())
buildConfigField("int", "LANGUAGE_RES", androidResources.localeFilters.size.toString())
}

signingConfigs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ object LanguagePrefUtil {
// check gradle resourceConfigurations count
actual = BuildConfig.LANGUAGE_RES
check(expected == actual) {
"android.defaultConfig.resourceConfigurations length, expected: %d, actual: %d."
"android.androidResources.localeFilters length, expected: %d, actual: %d."
.format(expected, actual)
}
}
Expand Down

0 comments on commit f3a36d0

Please sign in to comment.