tliron / ronin

A straightforward but powerful build system based on Ninja and Python
Apache License 2.0
60 stars 8 forks source link

Rōnin

A straightforward but powerful build system based on Ninja and Python, suitable for projects both big and small.

Rōnin comes in frustration-free packaging. Let's build all the things!

Features

Currently supported out-of-the-box: all gcc languages, Java, Rust, Go, Vala/Genie, pkg-config, Qt tools, sdl2-config, and binutils.

It's also easy to integrate your favorite testing framework.

"Based on Python" means that not only is it written in Python, but also it uses Python as the DSL for build scripts. Many build systems invent their own DSLs, but Rōnin intentionally uses a language that already exists. There's no hidden cost to this design choice: build scripts are pretty much as concise and coherent as any specialized DSL. You don't need to be an expert in Python to use Rōnin, but its power is at your fingertips if you need it.

Rōnin supports Unicode throughout: Ninja files are created in UTF-8 by default and you can include Unicode characters in your build scripts.

Python 3 is recommended, but Rōnin can also run on Python 2.7.

Download

The latest release is available on PyPI. To install on Debian/Ubuntu:

sudo apt install python3-pip
sudo -H pip3 install ronin

You also need Ninja. To install on Debian/Ubuntu:

sudo apt install ninja-build 

Note that Ninja is a small self-contained executable, so you might prefer to just download the most recent release. For Rōnin to be able to run it, it must be in either your execution path or the current directory. Or, you can run your build script with --set ninja.command= and give it the full path to Ninja.

Also note that instead of requiring your users to download Rōnin and Ninja, you can opt to include both with your project.

Documentation

An undocumented system is a broken system. We strive for coherent, comprehensive, and up-to-date documentation.

A detailed user manual is available on the wiki.

If you prefer to learn by example, there are many.

Rich API docs available on Read the Docs.

Feelings


Guiding lights:

  1. Powerful does not have to mean hard to use: optional auto-configuration with sensible, overridable defaults.
  2. Complex does not have to mean complicated: handle cross-compilation and other multi-configuration builds in a single script with minimal duplication of effort.

Design principles:

  1. Don't hide functionality behind complexity: the architecture should be straightforward. For example, if the user wants to manipulate a compiler command line, let them do it easily. Too many build systems bungle this and make it either impossible or very difficult to do something that would be trivial using a shell script.
  2. Pour some sugar on me: make common tasks easier with sweet utility functions. But make sure that sugar is optional, allowing the script to be more verbose when more control is necessary.
  3. Don't reinvent wheels: if Python or Ninja do something for us, use it. The build script is a plain Python program without any unnecessary cleverness. The generated Ninja file looks like something you could have created manually.

FAQ

Similar Projects