51 lines
1.3 KiB
TOML
51 lines
1.3 KiB
TOML
[env]
|
|
CV_INCLUDE_LINKS = { condition = { env_not_set = ["CV_INCLUDE_LINKS"] }, value = "true" }
|
|
CV_VERSION = { condition = { env_not_set = ["CV_VERSION"] }, value = "2024-03-01" }
|
|
|
|
# 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", "main.typ",
|
|
"--input", "language=${CV_LANG}",
|
|
"--input", "include_links=${CV_INCLUDE_LINKS}",
|
|
"--input", "version=${CV_VERSION}",
|
|
"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", "toml,typ", "--no-vcs-ignore", "makers build"]
|