API Grunts , taskFunction.
grunt foo, foo, no args, grunt foo:testing:123, foo, testing 123.
grunt.registerTask('foo', 'A sample task that logs stuff.', function(arg1, arg2) {
if (arguments.length === 0) {
grunt.log.writeln(this.name + ", no args");
} else {
grunt.log.writeln(this.name + ", " + arg1 + " " + arg2);
}
});
this grunt.registerTask taskFunction .
{ nameArgs: 'foo',
name: 'foo',
args: [],
flags: {},
async: [Function],
errorCount: [Getter],
requires: [Function],
requiresConfig: [Function],
options: [Function] }
grunt.registerMultiTask taskFunction .
{ nameArgs: 'my_task:files',
name: 'my_task',
args: [],
flags: {},
async: [Function],
errorCount: [Getter],
requires: [Function],
requiresConfig: [Function],
options: [Function],
data: { thefile: 'thesource' },
files: [],
filesSrc: [Getter],
target: 'files' }
, files my_task , .