Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Gant target named parameters

Razvan Dragut

2008-08-12

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi people,

I am new to Gant and I'm trying to rewrite my build system (good choice) .
Is it possible to have named parameters in a closure ? The reason I am
asking is that I need to replicate my ant macrodefs and keep working the
same way with defaults. As long as a Gant target is a closure I need to know
whether is possible to have named parameters in a closure or if there's a
slight diference between them then I would like to know which is that.

Here's my code that I am trying and I am royally failing :

target (test : 'test'){
     
        a='a',b='b' ->
       
        println(a);
        println(b);
}

target (test1 : 'test1'){
  test( b : 'c' );
}

setDefaultTarget ( test1 );

I would expect this to print :

a
c

instead, it prints :

["b":"c"]
b

Am I doing something wrong or is this how is supposed to work ?

can you help ?

Thanks very much

Razvan
--
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.