lib/robol.js
function(cfg, callback) {
  var lessCompiledCode = "";

  // Filter all Less files
  var lessFiles = filterInput(cfg.input_files, '.less');

  // Filter all Css files
  var cssFiles = filterInput(cfg.input_files, '.css');

  // Output file path
  var outputPath = path.join(cfg.output_dir, cfg.output_file);

  // Callback for Less compilation completed
  var onLessCompileComplete = function(result) {
    lessCompiledCode = result;
  };

  // Callback for style concatenation task
  var concatWithCssCompiledCode = function(result) {
    return result + '\n' + lessCompiledCode;
  };

  // Callback for lint task
  var onCSSLinted = function(blob) {
    if (blob.csslint && blob.csslint.length && blob.csslint[0].line !== undefined) {
      console.log('\nCSSLint reports issues in: '.red + blob.name);
      blob.csslint.forEach(function(i){
        if (i) {
          console.log(' Line ' + i.line + ', Col ' + i.col + ': ' + i.message);
        }
      });
    }
  };

  // Build Styles
  if (cssFiles.length+lessFiles.length > 0) {
    new gear.Queue({registry: taskRegistry}) // register tasks
    .log(formatLog('Building styles:', cssFiles.concat(lessFiles)))
    .tasks({
      readless:     {task: ['read', lessFiles]},
      combineless:  {requires: 'readless', task: 'safeconcat'},
      lesstocss:    {requires: 'combineless', task: ['lesscompile', {callback: onLessCompileComplete}]},
      readcss:      {requires: 'lesstocss', task: ['read', cssFiles]},
      lint:         {requires: 'readcss', task: cfg.lint ? ['csslint', {config: cfg.lint_config, callback: onCSSLinted}] : 'noop'},
      combinecss:   {requires: 'lint', task: 'safeconcat'},
      combineall:   {requires: 'combinecss', task: ['concat', {callback: concatWithCssCompiledCode}]},
      minify:       {requires: 'combineall', task: cfg.minify ? ['stylesminify', {minify: cfg.minify, yuicompress: cfg.minify_config.yuicompress}] : 'noop'},
      write:        {requires: 'minify', task: ['write', outputPath]}
    })
    .log(formatLog('Saved styles to: ', outputPath))
    .run(callback);
  } else {
    callback();
  }
}
function(cfg, callback) {
  var lessCompiledCode = "";

  // Filter all Less files
  var lessFiles = filterInput(cfg.input_files, '.less');

  // Filter all Css files
  var cssFiles = filterInput(cfg.input_files, '.css');

  // Output file path
  var outputPath = path.join(cfg.output_dir, cfg.output_file);

  // Callback for Less compilation completed
  var onLessCompileComplete = function(result) {
    lessCompiledCode = result;
  };

  // Callback for style concatenation task
  var concatWithCssCompiledCode = function(result) {
    return result + '\n' + lessCompiledCode;
  };

  // Callback for lint task
  var onCSSLinted = function(blob) {
    if (blob.csslint && blob.csslint.length && blob.csslint[0].line !== undefined) {
      console.log('\nCSSLint reports issues in: '.red + blob.name);
      blob.csslint.forEach(function(i){
        if (i) {
          console.log(' Line ' + i.line + ', Col ' + i.col + ': ' + i.message);
        }
      });
    }
  };

  // Build Styles
  if (cssFiles.length+lessFiles.length > 0) {
    new gear.Queue({registry: taskRegistry}) // register tasks
    .log(formatLog('Building styles:', cssFiles.concat(lessFiles)))
    .tasks({
      readless:     {task: ['read', lessFiles]},
      combineless:  {requires: 'readless', task: 'safeconcat'},
      lesstocss:    {requires: 'combineless', task: ['lesscompile', {callback: onLessCompileComplete}]},
      readcss:      {requires: 'lesstocss', task: ['read', cssFiles]},
      lint:         {requires: 'readcss', task: cfg.lint ? ['csslint', {config: cfg.lint_config, callback: onCSSLinted}] : 'noop'},
      combinecss:   {requires: 'lint', task: 'safeconcat'},
      combineall:   {requires: 'combinecss', task: ['concat', {callback: concatWithCssCompiledCode}]},
      minify:       {requires: 'combineall', task: cfg.minify ? ['stylesminify', {minify: cfg.minify, yuicompress: cfg.minify_config.yuicompress}] : 'noop'},
      write:        {requires: 'minify', task: ['write', outputPath]}
    })
    .log(formatLog('Saved styles to: ', outputPath))
    .run(callback);
  } else {
    callback();
  }
}
function ( cfg , callback ) { var lessCompiledCode = "" ; // Filter all Less files var lessFiles = filterInput ( cfg . input_files , '.less' ) ; // Filter all Css files var cssFiles = filterInput ( cfg . input_files , '.css' ) ; // Output file path var outputPath = path . join ( cfg . output_dir , cfg . output_file ) ; // Callback for Less compilation completed var onLessCompileComplete = function ( result ) { lessCompiledCode = result ; } ; // Callback for style concatenation task var concatWithCssCompiledCode = function ( result ) { return result + '\n' + lessCompiledCode ; } ; // Callback for lint task var onCSSLinted = function ( blob ) { if ( blob . csslint && blob . csslint . length && blob . csslint [ 0 ] . line !== undefined ) { console . log ( '\nCSSLint reports issues in: ' . red + blob . name ) ; blob . csslint . forEach ( function ( i ) { if ( i ) { console . log ( ' Line ' + i . line + ', Col ' + i . col + ': ' + i . message ) ; } } ) ; } } ; // Build Styles if ( cssFiles . length + lessFiles . length > 0 ) { new gear . Queue ( { registry : taskRegistry } ) // register tasks . log ( formatLog ( 'Building styles:' , cssFiles . concat ( lessFiles ) ) ) . tasks ( { readless : { task : [ 'read' , lessFiles ] } , combineless : { requires : 'readless' , task : 'safeconcat' } , lesstocss : { requires : 'combineless' , task : [ 'lesscompile' , { callback : onLessCompileComplete } ] } , readcss : { requires : 'lesstocss' , task : [ 'read' , cssFiles ] } , lint : { requires : 'readcss' , task : cfg . lint ? [ 'csslint' , { config : cfg . lint_config , callback : onCSSLinted } ] : 'noop' } , combinecss : { requires : 'lint' , task : 'safeconcat' } , combineall : { requires : 'combinecss' , task : [ 'concat' , { callback : concatWithCssCompiledCode } ] } , minify : { requires : 'combineall' , task : cfg . minify ? [ 'stylesminify' , { minify : cfg . minify , yuicompress : cfg . minify_config . yuicompress } ] : 'noop' } , write : { requires : 'minify' , task : [ 'write' , outputPath ] } } ) . log ( formatLog ( 'Saved styles to: ' , outputPath ) ) . run ( callback ) ; } else { callback ( ) ; } }
Loads, compiles, concatenates and minifies style files

@param {Object} cfg Build configuration
@param {Function} callback Task complete callback
Loads compiles concatenates and minifies style files