build_tools

Build tools is a build automation tool with a built-in command line shell.

Build tools includes libraries build_tools and build_shell.

The build_tools is a main library and used for specifying the targets, rules and files used in the project.

The build_shell library can be used for working with your project from the command line shell.

Without using the command line shell the configuration is performed directly in the source code.

Example of usage build_tools for bulding the Dart VM C++ native extension.

Short list of features:

Targets (tasks)

The targets describes the tasks and their dependencies (sources).

target("build", ["compile", "link"], (Target t, Map args) {
  // build  
});

Both types of target actions supported, synchronous and asynchronous.

target("build", ["compile", "link"], (Target t, Map args) {
  // failed
  return new Future.value(-1);
}, description: "Build project", reusable: true);

File targets

The file targets automatically generates the targets for files.

These targets executed only when files are out of date or does not exists.

file("hello.obj", ["hello.c"], (Target t, Map args) {
  // compile
});

Directory targets

The directory targets automatically generates the targets for directories.

These targets perform a single task, they create a directories.

directory("dist");
directories(["dist, "temp"]);

Rules

The rules automatically generates the targets by specified patterns.

rule("%.o", ["%.cc"], (Target t, Map args) {
  // compile
});
rules(["%.html", "%.htm"], ["%.md"], (Target t, Map args) {
  // transform
});

Hooks

The hooks allows specifying the target actions that will be performed before or after target actions.

after(["git:commit"], (Target t, Map args) {
  // action
});
before(["compile", "link"], (Target t, Map args) {
  // action
});

Build shell

The built-in build shell allows use the build scripts as command line scripts.

new BuildShell().run(args).then((exitCode) => exit(exitCode));

Libraries

build_tools
build_tools.build_utils
build_utils.build_shell