From 5941e228b48b294705d0a4f9142f20591b44cfd7 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sat, 6 Jan 2024 15:44:20 +0100 Subject: [PATCH] Add the cargo-make configuration file. --- Makefile.toml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Makefile.toml diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 0000000..80be8f6 --- /dev/null +++ b/Makefile.toml @@ -0,0 +1,44 @@ +# Shorthand to compile all the languages at once. +[tasks.build] +clear = true +dependencies = ["build-en", "build-nl"] + +# Compile using the English locale. +[tasks.build-en] +env = { CV_LANG="en" } +extend = "compile" + +# Compile using the Dutch locale. +[tasks.build-nl] +env = { CV_LANG="nl" } +extend = "compile" + +# Clean the repository by removing the build directory. +[tasks.clean] +clear = true +command = "gio" +args = ["trash", "build"] + +# Compile the Typst code into a PDF. +[tasks.compile] +clear = true +dependencies = ["ensure-build-dir"] +command = "typst" +args = [ + "compile", + "cv-${CV_LANG}.typ", + "build/CV-Bauke-${CV_LANG}.pdf" +] + +# Ensure that the build directory exists. +[tasks.ensure-build-dir] +clear = true +command = "mkdir" +condition = { files_not_exist = ["build/"] } +args = ["-p", "build"] + +# Watch the Typst files for changes and run the build task when they happen. +[tasks.watch] +clear = true +command = "watchexec" +args = ["-e", ".typ", "makers build"]