-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathJustfile
More file actions
executable file
·84 lines (75 loc) · 2.94 KB
/
Justfile
File metadata and controls
executable file
·84 lines (75 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
## Justfile - for build orchestration
## Copyright (C) 2024 - 2026 Kıvılcım İpek Afet Öztürk
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
set unstable
# for compiling Lua
lua := require("luajit") || require("./lua")
luac := require("luac")
luarocks := require("luarocks")
luacheck := require("luacheck")
# for testing environment
podman := require("podman")
busted := require("busted")
# for documentation
lualatex := which("lualatex")
# to hook up lament itself
lament := "src/cli/lament"
default:
just -l
[group("util")]
[doc('Sets up required programs for the environment')]
setup-env:
true
[group("test"), group("lint")]
[doc("Lints the rockspec.")]
lint-rockspec:
{{luarocks}} lint lament-*.rockspec
@echo "{{UNDERLINE + GREEN + BOLD}}Successfully linted rockspec.{{NORMAL}}"
[group("test"), group("lint"), doc("Lints the source code for the project.")]
lint-source:
{{luacheck}} src/*
@echo "{{UNDERLINE + GREEN + BOLD}}Successfully linted source code.{{NORMAL}}"
[group("test"), group("lint"), doc("Lints tests under spec/")]
lint-tests:
{{luacheck}} spec/*
@echo "{{UNDERLINE + GREEN + BOLD}}Successfully linted tests.{{NORMAL}}"
[group("test"), group("lint"), doc("Lints the project.")]
lint: lint-rockspec lint-source lint-tests
@echo "{{UNDERLINE + GREEN + BOLD}}Linting done.{{NORMAL}}"
[group("test"), doc("Checks the testing framework for bugs.")]
check-busted FORMAT="utfTerminal": lint
{{busted}} -v -o {{FORMAT}} spec/check_busted_spec.lua
@echo "{{UNDERLINE + GREEN + BOLD}}busted passed the bug check test."
[group("test"), doc("Runs tests")]
test FORMAT="utfTerminal": check-busted
{{busted}} -v -o {{FORMAT}}
[group("build")]
[doc("Compiles the project documentation.")]
doc-build:
mkdir -p docs/out
{{lualatex}} --halt-on-error --interaction=nonstopmode --output-directory=docs/out docs/README.tex
[group("build"), doc("Builds the project.")]
build: setup-env test
{{luarocks}} build
[group("build"), doc("Cleans the artifacts generated by build tasks.")]
clean:
{{luarocks}} remove --force lament || true
rm -f *.rock *.rockspec~
rm -f docs/out/* docs/chapters/*.aux docs/chapters/*.log docs/chapters/*.toc docs/chapters/*.dvi
rm -f docs/*.aux docs/*.log docs/*.toc docs/*.dvi docs/*.fdb_latexmk docs/*.fls
[group("exec")]
[doc("Executes the project")]
run *args:
{{lament}} {{args}}