Make a list of tasks (i.e. commands). Run them in a window or in a separate frame.
;;; This should be in a file named .tasklist.el in your project root.
;;; Nothing is eval'd.
((common
(:cwd "...")
(:env "X=Y" "A=B" ...)
(:variables
("project" . "Name")
("build" . "Debug")
("compiler" . "gcc")
...)
(tasks
(build
(:name "Build %project")
(:command "make CC=%compiler BUILD=%build"))
(run
(:name "Run %project")
(:command "make" "run")
(:cwd "bin"))))
tasklist-run
: Run a tasktasklist-menu
: Pop up a menu with taskstasklist-set-project-root
: Set global project override pathtasklist-set-project-default
: Set project path to use if no other project is current
For now there isn't much configuration beyond the above. Commands are in the following form:
(:command "BINARY-NAME" "ARG0 ARG1 ...")
The :name
is just a "pretty" name to display, and not strictly necessary. If :cwd
is specified, if it's file-absolute-p
, it will be treated as an absolute path, otherwise will be relative to the project root (as determined by projectile-project-root
).
There is also :window
:
(:window "Name")
This will call the buffer *Task: Project/Name*
. By using the same name for multiple tasks, you can cause the window to be shared/reused. (By default, the given :name
is used for each task.)
To set environment variables, use :env
:
(:env "VAR=VALUE" ...)
To set tasklist.el "variables,", use :variables
(only supported in the :common
section, see below):
(:variables
("project" . "My Project")
("build" . "Debug")
...)
These variables will be substituted in various strings throughout tasklist:
(:window "Testing %project")
(:cwd "build/%compiler-%build/")
For a literal %
, escape it as \%
.
The common
section does what it likely implies: sets default values for all tasks. Tasks may of course override these. Currently, :env
, :cwd
, :window
, and :variables
are supported.
If you want to bind keys, you can put things in your init.el
or wherever (but, obviously not in .tasklist.el
):
(global-set-key (kbd "f7") (lambda () (interactive) (tasklist-run 'build)))
This is more or less cmake-build.el with all the cmake stuff ripped out, and all the window and frame-handling things left .. which is a sizeable portion.
GPL3