おそらくはそれさえも平凡な日々

Daiku and Daikufile are now production ready

https://metacpan.org/release/Daiku

Daiku, building tool by perl now support many features inspired by rake and I released version 1.00.

We can automate building or any tasks in your project by using Daikufile and daiku command. Addtion, you can create your original automate tool by use Daiku; in your scripts.

Most of DSLs (ex. desc, task, rule, file, sh and namespace) are taken from rake then, you can write Daikufile as writing Rakefile.

Documantation is not enough and need enhancement.

We develop Daiku at following repository, hope many contribution from all over the world!

https://github.com/tokuhirom/Daiku

By the way, Daiku(大工) means carpenter in japanese.


Daiku 1.00をリリースしました。

欲しかった機能をだいたいrakeからパクってきたので、実用で使えるように なっていると思います。

目玉は、@ks0608 さんによるdaikuコマンドとDaikufile supportです。

プロジェクトにおいては、様々な定形操作が必要になり、そのためのスクリ プトが乱立したりしてしまったりするわけですが、そういうtaskを一元管理 するための仕組みとして、Daikfileは非常に便利です。以下の様な具合です。

namespace db => sub {
    desc 'データベースをmigrateします';
    task migrate => sub {
        sh 'tools/db/migrate';
    };
};

desc 'テスト回します';
task test => sub {
    my ($task, @args) = @_;
    sh qw(prove -lr), @args;
};

desc 'CPANモジュールをインストールします';
task install => sub {
    my ($task, @args) = @_;
    sh qw(cpanm --quiet --with-develop --notest --installdeps .), @args;
};

# 独自タスクは以下のファイルに定義すると捗りそう
do 'Daikufile.local';

これで、

% daiku -T

とかやると、タスクの一覧の表示ができます。

% daiku install

とかやるとプロジェクトに必要なCPANモジュールをインストールしてくれます。 以下のようにしてtaskに引数を渡すこともできます。

% daiku 'test[t/hoge/fuga.t xt/piyo.t]'

ブラケットを使うのはrakeと一緒ですが、引数のセパレーターの扱いが異なります。 rakeだとカンマ区切りですが、Daikuでは普通のコマンドラインと同じように扱いたい局面も多いので、空白区切りにしました。 引数の定義もDaikufileの中で行う必要はなく、普通にtaskの@argsに入ってきます。

Daikufileも結局の所perl scriptなので、do 'Daikufile.local';などどすればそっちに定義され ているtaskを簡単にincludeすることができるのが便利です。

本来の使い方とは少し異なるのでしょうが、Rakefileもそういう用途で使われていると思うので、1つ。

お使いいただいて、ご意見ご要望をいただけると嬉しいです。ドキュメントとかも足りてないので、もろもろpatches welcomeです!

created at
last modified at

2014-05-12T17:22:41+0900

comments powered by Disqus