aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/tasks/module/make.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/lua/tasks/module/make.lua b/lua/tasks/module/make.lua
new file mode 100644
index 0000000..3d176c1
--- /dev/null
+++ b/lua/tasks/module/make.lua
@@ -0,0 +1,22 @@
1local Path = require('plenary.path')
2
3return {
4 params = { 'cmd' },
5 condition = function() return Path:new('Makefile'):exists() end,
6
7 -- This module supports dynamic tasks by using the `__index` metamethod.
8 -- By default, for any string `<task>`, calling `Task start make <task>`
9 -- will run `make <task>` (i.e., dynamic tasks are mapped to make targets).
10 -- This behavior can be customized by overriding the task 'args' parameters
11 -- in the `default_params` provided on setup.
12 tasks = setmetatable({}, {
13 __index = function(_, target)
14 return function(module_config, _)
15 return {
16 cmd = module_config.cmd,
17 args = module_config.args and module_config.args[target] or { target },
18 }
19 end
20 end,
21 }),
22}