awesomewm.d.tl/justfile

70 lines
1.5 KiB
Makefile
Raw Normal View History

2022-06-26 17:37:53 +02:00
lua_version := "5.4"
2022-08-20 13:32:23 +02:00
lua := "lua" + " -l set_paths"
2022-08-09 23:32:30 +02:00
tl := "tl run" + " -l set_paths"
2022-06-26 17:37:53 +02:00
rocks_tree := "lua_modules"
rockspec_file := "awesomewmdtl-dev-1.rockspec"
2022-06-26 17:37:53 +02:00
lua_targets := `find src/ -type f -iname '*.lua' | xargs` + " " + `ls *.lua | xargs`
teal_targets := `find src/ types/ -type f -iname '*.tl' | xargs`
2023-09-18 11:44:19 +02:00
rockspec_targets := `find {.,rockspecs} -maxdepth 1 -type f -iname '*.rockspec' | xargs`
2022-06-26 17:37:53 +02:00
local-install-dependencies:
2022-08-09 23:32:30 +02:00
luarocks \
2022-06-26 17:37:53 +02:00
--lua-version {{ lua_version }} \
install \
--tree {{ rocks_tree }} \
--only-deps \
{{ rockspec_file }}
local-uninstall-dependencies:
2022-06-26 17:37:53 +02:00
rm -rf {{ rocks_tree }}
check-lua *FLAGS:
luacheck {{ lua_targets }} {{ FLAGS }}
2022-08-20 13:32:23 +02:00
check-teal:
cyan check {{ teal_targets }}
2022-06-26 17:37:53 +02:00
check-format:
stylua --check {{ lua_targets }}
2023-09-10 19:55:03 +02:00
check-rockspecs:
2023-09-18 11:44:19 +02:00
for rock in {{ rockspec_targets }}; do \
luarocks \
--lua-version {{ lua_version }} \
lint \
$rock ; \
done
2023-09-10 19:55:03 +02:00
check: check-lua check-format check-teal check-rockspecs
2022-08-20 13:32:23 +02:00
build:
cyan build
2022-06-26 17:37:53 +02:00
2022-10-04 20:42:11 +02:00
clean:
rm -rf build
2022-06-26 17:37:53 +02:00
run:
{{ tl }} src/awesomewmdtl/init.tl
2022-06-26 17:37:53 +02:00
2022-12-19 22:48:21 +01:00
validate:
cd generated && cyan \
check \
--global-env-def "global_env" \
2023-04-24 02:08:53 +02:00
awesomerc.tl
# `find . -type f -iname '*.d.tl' | xargs`
2022-12-19 22:48:21 +01:00
test PATTERN="_spec":
2023-09-18 12:22:05 +02:00
luarocks \
--lua-version {{ lua_version }} \
test \
{{ rockspec_file }} \
-- --pattern={{ PATTERN }}
2023-05-08 23:12:16 +02:00
# Requires a patched version of luacov (https://github.com/lunarmodules/luacov/issues/98#issuecomment-1530491759)
coverage:
busted --coverage
luacov