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
|
|
|
|
2022-10-11 18:34:07 +02:00
|
|
|
tl := "tl run" + " -l set_paths"
|
|
|
|
|
2022-06-26 17:37:53 +02:00
|
|
|
rocks_tree := "lua_modules"
|
2023-09-18 12:04:36 +02:00
|
|
|
rockspec_file := "awesomewmdtl-dev-1.rockspec"
|
2022-06-26 17:37:53 +02:00
|
|
|
|
2022-09-11 01:29:46 +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
|
|
|
|
2023-09-03 18:38:11 +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 }}
|
|
|
|
|
2023-09-03 18:38:11 +02:00
|
|
|
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:
|
2023-09-18 14:00:18 +02:00
|
|
|
luarocks \
|
|
|
|
--lua-version {{ lua_version }} \
|
|
|
|
make \
|
|
|
|
{{ rockspec_file }}
|
2022-06-26 17:37:53 +02:00
|
|
|
|
2023-09-18 14:18:58 +02:00
|
|
|
local-build:
|
|
|
|
luarocks \
|
|
|
|
--lua-version {{ lua_version }} \
|
|
|
|
make \
|
|
|
|
--tree {{ rocks_tree }} \
|
|
|
|
{{ rockspec_file }}
|
|
|
|
|
2022-10-04 20:42:11 +02:00
|
|
|
clean:
|
|
|
|
rm -rf build
|
|
|
|
|
2022-06-26 17:37:53 +02:00
|
|
|
run:
|
2023-09-18 12:04:36 +02:00
|
|
|
{{ tl }} src/awesomewmdtl/init.tl
|
2022-06-26 17:37:53 +02:00
|
|
|
|
2022-12-19 22:48:21 +01:00
|
|
|
validate:
|
2022-12-28 18:55:53 +01:00
|
|
|
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
|
|
|
|
2023-05-09 00:29:06 +02: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
|
|
|
|
2023-09-18 14:18:58 +02:00
|
|
|
local-test PATTERN="_spec":
|
|
|
|
luarocks \
|
|
|
|
--lua-version {{ lua_version }} \
|
|
|
|
test \
|
|
|
|
--tree {{ rocks_tree }} \
|
|
|
|
{{ 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
|