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
Your skill as shell programmer is?
- No skill (35%, 7 Votes)
- FreeTime coder (acceptable) (25%, 5 Votes)
- Developer (good) (15%, 3 Votes)
- Novice (15%, 3 Votes)
- Admin (very good) (10%, 2 Votes)
- Guru (perfect) (0%, 0 Votes)
Total Voters: 20
Loading ...
Most popular search terms:
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
|


















