abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md6
-rw-r--r--build.gradle.kts8
2 files changed, 14 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 89943a9..f2f37a6 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -11,6 +11,12 @@ Android Studio is not required. The build dependencies are:
Python 3 is required to update generated files but not to build the app.
+Make sure the Git submodules are initialized and point to the right revision:
+
+```sh
+git submodule update --init
+```
+
For Android Studio users, no more setup is needed.
For Nix users, the right environment can be obtained with `nix-shell ./shell.nix`.
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")