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.
Caution
This project is still in very early stages of development. Expect breaking changes. Stable API is guaranteed at v1.0.0
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 | β / β | β | β | β | β | β | β |
Bazel | β | β | β | β | β | β | β |
Gradle | β | β | β | β | β | β | β |
Make | β | β | β | β | β | β | β |
How many technologies are supported by the tool?
Skip tasks that are already done. This should be done using file content hashes.
How difficult is it to get started with the tool?
Use the tool to describe how the build process should be done.
Optionally parametrize build configurations.
Use a language to describe the build that is popular outside the tool.
It is easy to get the build working on different platforms.
Lua is a common and performant programming 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.
Documentation is in the DOCS.md file.
Run one or more configs:
yab run [configs ...]
Pass arguments to the scripts:
yab run [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/
If you run yab run
without any arguments, the default config (init.lua
) is used.
You can use a Lua language server to get autocompletion and type checking.
Run yab def
to create a definitions file in your global config directory.
Add it to your Lua language server configuration.
Global config is one of those directories:
$XDG_CONFIG_HOME/yab/
$APPDATA/yab/
$HOME/.config/yab/
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)
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 run env --attach sh
or start neovim using yab run env --attach nvim
.
brew tap tsukinoko-kun/tap
brew install tsukinoko-kun/tap/yab
go install github.com/tsukinoko-kun/yab@latest
- name: Use Yab
uses: tsukinoko-kun/use-yab@v1
You can specify a version using the version
input. The default is latest
.
- name: Use Yab
uses: tsukinoko-kun/use-yab@v1
with:
version: 0.3.0
Use the badge to show that your project uses Yab. This helps to spread the word about Yab and makes it easier for others to work on your project.
This is just a suggestion. You don't have to use it.
[![Yab Project](https://img.shields.io/badge/Yab_Project-2C2D72?logo=lua)](https://github.com/tsukinoko-kun/yab)