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"
|
|
|
|
rockspec_file := "rockspecs/awesomewm.d.tl-dev-1.rockspec"
|
|
|
|
|
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`
|
2022-06-26 17:37:53 +02:00
|
|
|
|
|
|
|
install:
|
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 }}
|
|
|
|
|
2022-08-07 20:56:42 +02:00
|
|
|
uninstall:
|
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 }}
|
|
|
|
|
2022-08-20 13:32:23 +02:00
|
|
|
check: check-lua check-format check-teal
|
|
|
|
|
|
|
|
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:
|
2022-10-11 18:34:07 +02:00
|
|
|
{{ tl }} src/awesomewm.d.tl/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" \
|
|
|
|
`find . -type f -iname '*.d.tl' | xargs`
|
2022-12-19 22:48:21 +01:00
|
|
|
|
2023-04-17 00:05:15 +02:00
|
|
|
test: build
|
|
|
|
rm -rf spec
|
|
|
|
mv build/spec spec
|
|
|
|
busted
|
|
|
|
# luarocks \
|
|
|
|
# --lua-version {{ lua_version }} \
|
|
|
|
# test \
|
|
|
|
# --tree {{ rocks_tree }} \
|
|
|
|
# {{ rockspec_file }}
|
|
|
|
|
2022-08-20 13:32:23 +02:00
|
|
|
# TODO : how to run a debugger on Teal code?
|
2022-06-26 17:37:53 +02:00
|
|
|
debug:
|
2022-10-11 18:32:40 +02:00
|
|
|
{{ lua }} debug.lua build/awesomewm.d.tl/init.lua
|
2022-10-11 18:34:07 +02:00
|
|
|
debug-gen:
|
|
|
|
cyan gen --output set_paths.lua --gen-compat "off" set_paths.tl
|
|
|
|
sed -i 's/"src\/awesomewm.d.tl"/"build\/awesomewm.d.tl"/g' set_paths.lua
|
|
|
|
stylua set_paths.lua
|