Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

66 lines (55 sloc) 1.935 kb
var sys = require('sys'),
fs = require('fs');
desc('This is the default task.');
task('default', [], function () {
console.log('Running the default task.');
console.log(sys.inspect(arguments));
});
desc('This is the asdf task. It depends on both qwer and the default');
task('asdf', ['qwer', 'default'], function () {
console.log('Running the asdf task.');
console.log(sys.inspect(arguments));
});
desc('This is the qwer task. It depends on zxcv, uiop, and the default');
task('qwer', ['zxcv', 'uiop', 'default'], function () {
console.log('Running the qwer task.');
console.log(sys.inspect(arguments));
});
desc('This is the zxcv task. It depends on the default');
task('zxcv', ['default'], function () {
console.log('Running the zxcv task.');
console.log(sys.inspect(arguments));
});
desc('This is the uiop task. It depends on the default');
task('uiop', ['default'], function () {
console.log('Running the uiop task.');
console.log(sys.inspect(arguments));
});
desc('File task, concating two files together');
file('concat.txt', ['src1.txt', 'src2.txt'], function() {
console.log('doing concat.txt file-task');
var data1 = fs.readFileSync('src1.txt');
var data2 = fs.readFileSync('src2.txt');
fs.writeFileSync('concat.txt', data1 + data2);
});
namespace('foo', function () {
desc('This the foo:bar task');
task('bar', ['default', 'foo:qux', 'foo:baz'], function () {
console.log('doing foo:bar task');
console.log(sys.inspect(arguments));
});
desc('This the foo:baz task');
task('baz', [], function () {
console.log('doing foo:baz task');
console.log(sys.inspect(arguments));
});
desc('This the foo:qux task');
task('qux', [], function () {
console.log('starting async foo:qux task');
console.log(sys.inspect(arguments));
setTimeout(function () {
console.log('completing async foo:qux task');
complete();
}, 0);
}, true);
});
Jump to Line
Something went wrong with that request. Please try again.