README ¶
Yab
Yet another build tool 👷 🚧
Wouldn't it be great if you could use the same build tool for every project? Regardless of operating system, programming language...
Yab is just that.
Use Lua scripts to define specific actions and execute them from the command line.
Does that not already exist?
No!
Builtin support for many technologies | Smart incremental build | Easy to setup and extend | Imperative syntax (loops, functions, ...) | Parameters | No domain specific language | Cross-platform by default | |
Yab | :x: / :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Bazel | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: |
Gradle | :white_check_mark: | :grey_question: | :x: | :x: | :x: | :x: | :white_check_mark: |
Make | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
Explanation
Built-in support for many technologies
How many technologies are supported by the tool?
Smart incremental build
Skip tasks that are already done. This should be done using file content hashes.
Easy to set up and extend
How difficult is it to get started with the tool?
Imperative syntax
Use the tool to describe how the build process should be done.
Parameters
Optionally parametrize build configurations.
No domain specific language
Use a language to describe the build that is popular outside the tool.
Cross-platform by default
It is easy to get the build working on different platforms.
Lua is a common and performant language. Yab offers some useful functions in addition to the Lua standard library that might be useful when building configurations.
Looking for an example configuration?
Take a look at this projects .yab
folder.
Installation
Homebrew
brew tap Frank-Mayer/tap
brew install Frank-Mayer/tap/yab
Go install
go install github.com/Frank-Mayer/yab@latest
Binary from release
Docs
Documentation is in the DOCS.md file.
Usage
Run one or more configs:
yab [configs ...]
Pass arguments to the scripts:
yab [configs ...] -- [args ...]
A config is a lua file inside the config directory.
The following directories are used as configs (first found wins)
./.yab/
$XDG_CONFIG_HOME/yab/
$APPDATA/yab/
$HOME/.config/yab/
Lua definitions
Run yab --def
to create a definitions file in your global config directory.
Use this to configure your Lua language server.
Global config is one of those directories:
$XDG_CONFIG_HOME/yab/
$APPDATA/yab/
$HOME/.config/yab/
Example Code
local yab = require("yab")
-- use a specific Go version
yab.use("golang", "1.21.6")
-- os specific name
local bin_name = yab.os_type() == "windows" and "yab.exe" or "yab"
-- incremental build
yab.task(yab.find("**.go"), bin_name, function()
os.execute('go build -ldflags="-s -w" -o ' .. bin_name .. " ./cmd/yab/")
end)
Attach external applications
I like to create an env.lua
config where all shared tools are defined.
local yab = require("yab")
yab.use("golang", "1.21.6")
yab.use("nodejs", "20.11.1")
I now can start a shell using the specified environment using yab env --attach sh
or start neovim using yab env --attach nvim
.
Badge
[![Yab Project](https://img.shields.io/badge/Yab_Project-2C2D72?logo=lua)](https://github.com/Frank-Mayer/yab)
Documentation ¶
There is no documentation for this package.