diff options
| author | Jules Aguillon | 2024-01-21 16:34:49 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2024-01-21 16:34:49 +0100 |
| commit | ad7314a01684185f5cf33cc31ef35d1027776a88 (patch) | |
| tree | 189c2f9c8e085335689dfe30cb907cea5ba5c08e /build.gradle | |
| parent | bef29da3dee4aadc1f2c199cea846502e14aca5b (diff) | |
| download | unexpected-keyboard-ad7314a01684185f5cf33cc31ef35d1027776a88.tar.gz unexpected-keyboard-ad7314a01684185f5cf33cc31ef35d1027776a88.zip | |
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.
Diffstat (limited to 'build.gradle')
| -rw-r--r-- | build.gradle | 27 |
1 files changed, 16 insertions, 11 deletions
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" + } +} |
