86 lines
1.8 KiB
Makefile
86 lines
1.8 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:
|
|
luarocks \
|
|
--lua-version {{ lua_version }} \
|
|
make \
|
|
{{ rockspec_file }}
|
|
|
|
local-build:
|
|
luarocks \
|
|
--lua-version {{ lua_version }} \
|
|
make \
|
|
--tree {{ rocks_tree }} \
|
|
{{ rockspec_file }}
|
|
|
|
clean:
|
|
rm -rf build
|
|
|
|
run:
|
|
{{ tl }} src/awesomewmdtl/init.tl
|
|
|
|
validate:
|
|
cd generated && cyan \
|
|
check \
|
|
awesomerc.tl
|
|
|
|
test PATTERN="_spec":
|
|
luarocks \
|
|
--lua-version {{ lua_version }} \
|
|
test \
|
|
{{ rockspec_file }} \
|
|
-- --pattern={{ PATTERN }}
|
|
|
|
local-test PATTERN="_spec":
|
|
luarocks \
|
|
--lua-version {{ lua_version }} \
|
|
test \
|
|
--tree {{ rocks_tree }} \
|
|
{{ rockspec_file }} \
|
|
-- --pattern={{ PATTERN }}
|
|
|
|
# Requires a patched version of luacov (https://github.com/lunarmodules/luacov/issues/98#issuecomment-1530491759)
|
|
coverage:
|
|
busted --coverage
|
|
luacov
|