From a26c69abd16e01abc0bf230a3f69141e6ad5271d Mon Sep 17 00:00:00 2001 From: crackededed <90209774+crackededed@users.noreply.github.com> Date: Wed, 29 May 2024 18:55:03 +0300 Subject: [PATCH] auto generate locale config --- app/build.gradle.kts | 8 +++++--- app/src/main/AndroidManifest.xml | 1 - app/src/main/res/resources.properties | 1 + app/src/main/res/xml/locales_config.xml | 16 ---------------- build.gradle.kts | 8 -------- gradle.properties | 4 ++-- gradle/libs.versions.toml | 4 ++-- settings.gradle.kts | 9 ++++++++- 8 files changed, 18 insertions(+), 33 deletions(-) create mode 100644 app/src/main/res/resources.properties delete mode 100644 app/src/main/res/xml/locales_config.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 46c5f5485..353bff23f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -30,16 +30,15 @@ android { targetSdk = 34 versionCode = 121 versionName = "2.32.0" - resourceConfigurations += listOf("ar", "de", "en", "es", "fr", "in", "it", "ja", "pt-rBR", "ru", "tr", "zh-rTW", "zh-rCN") } buildTypes { - getByName("debug") { + debug { applicationIdSuffix = ".debug" versionNameSuffix = "-DEBUG" signingConfig = signingConfigs.getByName("debug") } - getByName("release") { + release { isShrinkResources = true isMinifyEnabled = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") @@ -50,6 +49,9 @@ android { buildConfig = true viewBinding = true } + androidResources { + generateLocaleConfig = true + } lint { disable += "ContentDescription" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ed2c07551..ea87a8492 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,7 +19,6 @@ android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" - android:localeConfig="@xml/locales_config" android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="true" android:theme="@style/DarkTheme" diff --git a/app/src/main/res/resources.properties b/app/src/main/res/resources.properties new file mode 100644 index 000000000..d5a3ddc92 --- /dev/null +++ b/app/src/main/res/resources.properties @@ -0,0 +1 @@ +unqualifiedResLocale=en-US \ No newline at end of file diff --git a/app/src/main/res/xml/locales_config.xml b/app/src/main/res/xml/locales_config.xml deleted file mode 100644 index d3748aaa0..000000000 --- a/app/src/main/res/xml/locales_config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index f1e41c5e4..a20e1221a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. -plugins { - alias(libs.plugins.android.application) apply false - alias(libs.plugins.kotlin) apply false - alias(libs.plugins.kotlin.parcelize) apply false - alias(libs.plugins.ksp) apply false - alias(libs.plugins.hilt) apply false -} - tasks.register("clean", Delete::class) { delete(rootProject.layout.buildDirectory) } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 3c5031eb7..20e2a0152 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,8 +8,8 @@ # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects # org.gradle.parallel=true # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app's APK diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 39a44fca5..a2fe4ec90 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,8 +17,8 @@ gson = "2.11.0" hilt = "2.51.1" hilt-extension-compiler = "1.2.0" hilt-work = "1.2.0" -kotlin = "1.9.24" -ksp = "1.9.24-1.0.20" +kotlin = "2.0.0" +ksp = "2.0.0-1.0.21" lifecycle = "2.8.0" material = "1.12.0" media3 = "1.3.1" diff --git a/settings.gradle.kts b/settings.gradle.kts index a1077105b..bdef3a287 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,12 @@ pluginManagement { repositories { - google() + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } mavenCentral() gradlePluginPortal() } @@ -13,5 +19,6 @@ dependencyResolutionManagement { jcenter() } } + rootProject.name = "Xtra" include(":app")