From dfaf4dbb5766bf134cbf97d0516493e2256d2e5a Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 27 Dec 2025 23:49:50 +0100 Subject: More practical definition of method.xml (#1149) Locale are now defined in `gen_method_xml.py` in a more convenient and checked way. It contains both the locale definition and the generation script. `method.xml` is generated with: gradle test The goal is to support dictionaries for spell checking.--- build.gradle.kts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index 912409b..e111ac8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -113,6 +113,16 @@ val genLayoutsList by tasks.registering(Exec::class) { commandLine("python", "gen_layouts.py") } +val genMethodXml by tasks.registering(Exec::class) { + val out = projectDir.resolve("res/xml/method.xml") + inputs.file(projectDir.resolve("gen_method_xml.py")) + outputs.file(out) + doFirst { println("\nGenerating res/xml/method.xml") } + doFirst { standardOutput = FileOutputStream(out) } + workingDir = projectDir + commandLine("python", "gen_method_xml.py") +} + val checkKeyboardLayouts by tasks.registering(Exec::class) { inputs.dir(projectDir.resolve("srcs/layouts")) inputs.file(projectDir.resolve("srcs/juloo.keyboard2/KeyValue.java")) @@ -137,7 +147,7 @@ val compileComposeSequences by tasks.registering(Exec::class) { } tasks.withType(Test::class).configureEach { - dependsOn(genLayoutsList, checkKeyboardLayouts, compileComposeSequences) + dependsOn(genLayoutsList, checkKeyboardLayouts, compileComposeSequences, genMethodXml) } val initDebugKeystore by tasks.registering(Exec::class) { @@ -165,5 +175,5 @@ tasks.named("preBuild") { // Gradle) but doesn't create a dependency. These rules update files that are // checked in the repository that don't need to be updated during regular // builds. - mustRunAfter(genEmojis, genLayoutsList, compileComposeSequences) + mustRunAfter(genEmojis, genLayoutsList, compileComposeSequences, genMethodXml) } -- cgit v1.2.3