deva-rajan / hamake

Automatically exported from code.google.com/p/hamake
0 stars 0 forks source link

A new task type for defining functions #51

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice to add a new type of task, that will allow to define functions 
(written in Java, Jython, JavaScript, AWK, etc. ) specified either directly 
within Hamake-file or as a reference to external file. Task will be defined by 
a tag '<function>', with two optional attributes: 'language=' and 'file', and 
one mandatory - 'id'. In case language is not specified, JavaScript will be 
used. 'file' attribute will be used to reference a file with script or program. 
 Unlike 'exec' task, 'function' task will have a direct read and write access 
to properties, defined globally for the Hamake-file. Also, one will be able to 
use functions for evaluation of expressions. Such tasks will allow to make 
Hamake-file less awkward and reduce its size by elimination need to use 
'<parameter>' tag to pass values of properties at a script. 'function' tasks 
will be useful for those, who want to add some complicated logic at the 
execution flow, e.g. run tasks only during specified time of a day, set a 
parameter according to some OS parameter, modify output of one task, before 
passing it as an input to other, e.t.c.  Vadim, Peter could you please comment 
this request for a new feature?  Vladimir

Original issue reported on code.google.com by v...@codeminders.com on 5 Aug 2011 at 9:13