crodas/build

Simple build tools

v0.2.0 2015-10-25 22:10 UTC

This package is auto-updated.

Last update: 2024-04-12 17:47:15 UTC


README

Build is a task management and automation tool. It was inspired in Makefile and Python's doit

Concepts

  • 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']);