diff options
Diffstat (limited to 'ui/build.gradle.kts')
-rw-r--r-- | ui/build.gradle.kts | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 58a6a687..16b82f70 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -1,6 +1,11 @@ @file:Suppress("UnstableApiUsage") + import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import com.android.build.gradle.tasks.ExtractSupportedLocalesTask + +// Grotesque workaround for https://issuetracker.google.com/issues/279780940 +System.setProperty("com.android.tools.r8.disableApiModeling", "1") val pkg: String = providers.gradleProperty("wireguardPackageName").get() val appID: String = providers.gradleProperty("wireguardApplicationID").get() @@ -9,6 +14,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.ajoberstar.grgit) } android { @@ -24,9 +30,11 @@ android { minSdk = 21 targetSdk = 33 versionCode = providers.gradleProperty("wireguardVersionCode").get().toInt() - versionName = providers.gradleProperty("wireguardVersionName").get() + versionName = grgit.describe { + tags = true + always = true + }.replace('-', '.') buildConfigField("int", "MIN_SDK_VERSION", minSdk.toString()) - buildConfigField("boolean", "IS_GOOGLE_PLAY", false.toString()) } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 @@ -50,6 +58,7 @@ android { resources { excludes += "DebugProbesKt.bin" excludes += "kotlin-tooling-metadata.json" + excludes += "META-INF/*.version" } } } @@ -60,9 +69,12 @@ android { } create("googleplay") { initWith(getByName("release")) - buildConfigField("boolean", "IS_GOOGLE_PLAY", true.toString()) + matchingFallbacks += "release" } } + androidResources { + generateLocaleConfig = true + } lint { disable += "LongLogTag" warning += "MissingTranslation" @@ -97,3 +109,12 @@ tasks.withType<JavaCompile>().configureEach { tasks.withType<KotlinCompile>().configureEach { compilerOptions.jvmTarget.set(JvmTarget.JVM_17) } + +// Grotesque workaround for https://issuetracker.google.com/issues/281825213 +tasks.withType<ExtractSupportedLocalesTask>().configureEach { + doLast { + val file = localeList.asFile.get() + val lines = file.readLines() + file.writeText((listOf(lines[0]) + lines.subList(1, lines.size).sorted()).joinToString(separator = "\n")) + } +}
\ No newline at end of file |