summaryrefslogtreecommitdiffhomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-05-17 13:33:58 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2023-05-26 16:19:52 +0200
commit37a892a2dadb15296c88cc4de2df66b2188db6a8 (patch)
tree4b881f7b01de39028e97cef42960fa724cc2d5a5 /ui
parentf2d166a6a45b28052662e68fda4c0f6fe0d097fe (diff)
gradle: sort extracted locales rather than generated XML
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/build.gradle.kts12
1 files changed, 5 insertions, 7 deletions
diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts
index ac92211a..136c636a 100644
--- a/ui/build.gradle.kts
+++ b/ui/build.gradle.kts
@@ -2,7 +2,7 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import com.android.build.gradle.tasks.GenerateLocaleConfigTask
+import com.android.build.gradle.tasks.ExtractSupportedLocalesTask
// Grotesque workaround for https://issuetracker.google.com/issues/279780940
System.setProperty("com.android.tools.r8.disableApiModeling", "1")
@@ -97,12 +97,10 @@ tasks.withType<KotlinCompile>().configureEach {
}
// Grotesque workaround for https://issuetracker.google.com/issues/281825213
-tasks.withType<GenerateLocaleConfigTask>().configureEach {
+tasks.withType<ExtractSupportedLocalesTask>().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"))
- }
+ 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