Home

Awesome

dale: a paranoid D task runner

pocket sand

EXAMPLE

$ cd example

$ dub run dale
Running .dub/build/test/arithmancy-test-unittest

$ dub run dale -- -h
Usage: ../.dub/build/bin/dale [OPTIONS]
-l    --list
-v --version
-h    --help This help information.

ABOUT

dale is a task runner for D projects, a more portable alternative to makefiles. dale wraps common dub workflows, providing a convenient way to kick off your various build commands.

DUB

https://code.dlang.org/packages/dale

LICENSE

BSD-2-Clause

RUNTIME REQUIREMENTS

INSTALL

$ dub fetch dale

SETUP

dale.d

Write some tasks in a dale.d build configuration script at the top-level directory of your D project:

import dl;

immutable VERSION = "0.0.1";

@(TASK)
void banner() {
    writefln("arithmancy %s", VERSION);
}

@(TASK)
void test() {
    exec("dub", ["test"]);
}

@(TASK)
void build() {
    deps(test);
    exec("dub", ["build"]);
}

@(TASK)
void clean() {
    exec("dub", ["clean"]);
}

@(TASK)
void main(string[] args) {
    phony([&clean]);
    mixin(yyyup!("args", "build"));
}

dub.sdl / dub.json

Now, wire up the dale command line interface by configuring your top-level dub.sdl or dub.json:

configuration "shi_sha" {
    targetName "dale"
    targetType "executable"
    targetPath ".dub/build/shi_sha"
    mainSourceFile "dale.d"
    dependency "dale" version="0.0.1"
}
{
    "configurations": [
        {
            "name": "shi_sha",
            "targetName": "dale",
            "targetType": "executable",
            "targetPath": ".dub/build/shi_sha",
            "mainSourceFile": "dale.d",
            "dependencies": {
                "dale": "0.0.1"
            }
        }
    ]
}

Watch how he behaves... I hope dale is practicing good manners :P

What happens when you run:

DEBRIEFING

Let's break down the code so far:

DoN't UsE sHelL cOmMaNdS!1

Just because the dale library offers several supremely convenient macros for executing shell commands doesn't mean that you should always shell out. No way, man!

Whenever possible, use regular D code, as in the banner() example. There's like a ba-jillion packages of prewritten D code, so you might as well use it! Dale uses no DSL's, just plain old D code, so it's easy to integrate with other D libraries.

CONTRIBUTING

For more details on developing dale itself, see DEVELOPMENT.md.

SEE ALSO

EVEN MORE EXAMPLES