From ad7314a01684185f5cf33cc31ef35d1027776a88 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 21 Jan 2024 16:34:49 +0100 Subject: Move layout definitions into srcs/layouts This separates the layout definitions from the special layouts (bottom_row, greekmath) and other unrelated files (method, settings). This is also a more intuitive location for layouts and make the resource directory easier to navigate. Under the hood, layouts are copied back into build/generated-resources/xml. --- build.gradle | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index b2ea12d..1f12e56 100644 --- a/build.gradle +++ b/build.gradle @@ -115,17 +115,13 @@ tasks.register('genLayoutsList') { tasks.register('checkKeyboardLayouts') { println "\nChecking layouts" - new ByteArrayOutputStream().withStream { bos -> - exec { - def layouts = new File(projectDir, "res/xml").listFiles().findAll { - it.isFile() && it.name.endsWith(".xml") - } - workingDir = projectDir - commandLine("python", "check_layout.py", *layouts) - standardOutput = bos + exec { + def layouts = new File(projectDir, "srcs/layouts").listFiles().findAll { + it.name.endsWith(".xml") } - - new File(projectDir, "check_layout.output").write(bos.toString()) + workingDir = projectDir + commandLine("python", "check_layout.py", *layouts) + standardOutput = new FileOutputStream("${projectDir}/check_layout.output") } } @@ -140,6 +136,7 @@ tasks.register('syncTranslations') { tasks.named("preBuild") { dependsOn += "initDebugKeystore" dependsOn += "copyRawQwertyUS" + dependsOn += "copyLayoutDefinitions" } tasks.register('initDebugKeystore') { @@ -156,7 +153,15 @@ tasks.register('initDebugKeystore') { tasks.register('copyRawQwertyUS') { copy { - from "res/xml/latn_qwerty_us.xml" + from "srcs/layouts/latn_qwerty_us.xml" into "build/generated-resources/raw" } } + +tasks.register('copyLayoutDefinitions') +{ + copy { + from "srcs/layouts" + into "build/generated-resources/xml" + } +} -- cgit v1.2.3