From 9972d9607ed61ea2bc79e113807259c4e62ed5b2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 12 May 2023 15:55:31 +0200 Subject: gradle: sort lines in localeConfig This works around https://issuetracker.google.com/issues/281825213 Signed-off-by: Jason A. Donenfeld --- ui/build.gradle.kts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 8368e7e6..ac92211a 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import com.android.build.gradle.tasks.GenerateLocaleConfigTask // Grotesque workaround for https://issuetracker.google.com/issues/279780940 System.setProperty("com.android.tools.r8.disableApiModeling", "1") @@ -94,3 +95,14 @@ tasks.withType().configureEach { tasks.withType().configureEach { compilerOptions.jvmTarget.set(JvmTarget.JVM_17) } + +// Grotesque workaround for https://issuetracker.google.com/issues/281825213 +tasks.withType().configureEach { + doLast { + localeConfig.asFileTree.files.forEach { + val lines = it.readLines() + val newLines = lines.subList(0, 2) + lines.subList(2, lines.size - 1).sorted() + lines.last() + it.writeText(newLines.joinToString(separator = "\n")) + } + } +} \ No newline at end of file -- cgit v1.2.3