abouttreesummaryrefslogcommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authorJules Aguillon2026-02-24 22:50:16 +0100
committerGitHub2026-02-24 22:50:16 +0100
commit9863dcea9eaa197177552f8621091b3e0858cc76 (patch)
tree1453cfaa99be1bed02e46341b327b287ea5a5ffd /build.gradle.kts
parenta80afa5fbebd023167394cdc3e31fc26790cffaa (diff)
downloadunexpected-keyboard-9863dcea9eaa197177552f8621091b3e0858cc76.tar.gz
unexpected-keyboard-9863dcea9eaa197177552f8621091b3e0858cc76.zip
gradle: Show an error when Git submodules are not initialized (#1188)
* CONTRIBUTING: Document Git submodules * build: Error during build if the submodules are not initialized
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts8
1 files changed, 8 insertions, 0 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 782b8db..8c8b6d7 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -92,6 +92,14 @@ android {
}
}
+
+// This raises an error with an informative message instead of the confusing
+// ndk-build errors that occur when submodules are not initialized.
+gradle.projectsEvaluated {
+ if (!file("vendor/cdict/java").exists())
+ throw GradleException("Git submodules not initialized. Run 'git submodule update --init'")
+}
+
val buildKeyboardFont by tasks.registering(Exec::class) {
val `in` = projectDir.resolve("srcs/special_font")
val out = layout.projectDirectory.file("assets/special_font.ttf")