Build
is a task management and automation tool. It was inspired in Makefile
and Python's doit
- Annotations are used to define
tasks
crodas/Build
do not build things unless they are needed:- When there is no output file
- When any input file changes
<?php // Tasks.php
/**
* @Task(build_site)
*/
function concat_files($output, Array $input, Array $settings $builder)
{
/* Do something with the input files */
$content = "";
foreach ($input as $f) {
$content .= file_get_contents($f);
}
/* Write it in the $output file */
file_put_contents($output, $content);
}
<?php // build.php
$builder = new crodas\Build("/tasks.php");
$bundle_js = $build->build_site(['foo.js', 'xxx.js']);