Custom target parameters. Using closures or grobal def.By neokrates, written on June 2, 2010 |
gant snippet |
- neokrates
- Email: uwarov@yahoo.com
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 20
Rate it
Ad
Poll
Loading ...
Most popular search terms:
Stats
-
Since publication, this page was visited 174 time(s).
There seems to be some kind of problem with giving custom arguments to GAnt target.
There where an el way, closure like way and now there is a mention about single parameter which must be a map or so.
Anyways, here are two alternative ways to solve the problem.
Use closures with parameters:
def sayMyName = { name -> println "Your name is $name " } target ( default: '' ) { sayMyName ('Dimitri') }
Remark. Closures are no targets, they are treated differently. There are interaction issues between closures and ant target. I see it as a risk factor.
Define global variables:
def name = '' target ( sayMyName : 'Will say the name' ) { println "Your name is $name " } target ( default: '' ) { name = 'Dimitri' sayMyName () }
|
TAGS
|
|
SOCIAL
|


















