awesomewm.d.tl/justfile

70 lines
1.5 KiB
Makefile

lua_version := "5.4"
lua := "lua" + " -l set_paths"
tl := "tl run" + " -l set_paths"
rocks_tree := "lua_modules"
rockspec_file := "awesomewmdtl-dev-1.rockspec"
lua_targets := `find src/ -type f -iname '*.lua' | xargs` + " " + `ls *.lua | xargs`
teal_targets := `find src/ types/ -type f -iname '*.tl' | xargs`
rockspec_targets := `find {.,rockspecs} -maxdepth 1 -type f -iname '*.rockspec' | xargs`
local-install-dependencies:
luarocks \
--lua-version {{ lua_version }} \
install \
--tree {{ rocks_tree }} \
--only-deps \
{{ rockspec_file }}
local-uninstall-dependencies:
rm -rf {{ rocks_tree }}
check-lua *FLAGS:
luacheck {{ lua_targets }} {{ FLAGS }}
check-teal:
cyan check {{ teal_targets }}
check-format:
stylua --check {{ lua_targets }}
check-rockspecs:
for rock in {{ rockspec_targets }}; do \
luarocks \
--lua-version {{ lua_version }} \
lint \
$rock ; \
done
check: check-lua check-format check-teal check-rockspecs
build:
cyan build
clean:
rm -rf build
run:
{{ tl }} src/awesomewmdtl/init.tl
validate:
cd generated && cyan \
check \
--global-env-def "global_env" \
awesomerc.tl
# `find . -type f -iname '*.d.tl' | xargs`
test PATTERN="_spec":
luarocks \
--lua-version {{ lua_version }} \
test \
{{ rockspec_file }} \
-- --pattern={{ PATTERN }}
# Requires a patched version of luacov (https://github.com/lunarmodules/luacov/issues/98#issuecomment-1530491759)
coverage:
busted --coverage
luacov