groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Rubel <oru...@gmail.com>
Subject Re: About the syntax of groovy
Date Sun, 01 Nov 2015 18:55:58 GMT
Do we have to say that? I don't recall ever saying Spring Groovy, Pivotal
Groovy or VMWare Groovy ;)

I have referenced it by saying 'it's DAMN Groovy' though :)


Owen Rubel
415-971-0976
orubel@gmail.com

On Sun, Nov 1, 2015 at 10:51 AM, Russel Winder <russel@winder.org.uk> wrote:

> On Fri, 2015-10-30 at 09:53 -0700, daniel_sun wrote:
> > Hi all,
> >
> >      Could you tell me the following gradle code comply with the
> > syntax of
> > groovy?  The 'task' can be a method, what about 'taskA' and
> > '<<'?  Thanks in
> > advance.
> >
> > task taskA << {
> >     println "i'm task A"
> > }
>
> If I remember correctly, this syntax only works because Gradle applies
> an AST transform to the code. The more tradition Groovy code that this
> gets transformed to is:
>
> task('taskA') << {
>     println "i'm task A"
> }
>
> which is pure Groovy.
>
> Though I suspect I am now going to have to say Apache Groovy now.
>
> > ----------- my experimental code, but failed with exceptions
> > -----------------
> > def task(t) {
> >     t()
> > }
> >
> > task taskA << {
> >     println "i'm task A"
> > }
> > =================
> > groovy.lang.MissingPropertyException: No such property: taskA for
> > class:
> > ConsoleScript8
> >
> >         at ConsoleScript8.run(ConsoleScript8:5)
> > ----------------------------
> >
> >
> >
> > --
> > View this message in context: http://groovy.329449.n5.nabble.com/Abou
> > t-the-syntax-of-groovy-tp5729026.html
> > Sent from the Groovy Users mailing list archive at Nabble.com.
> --
> Russel.
>
> =============================================================================
> Dr Russel Winder      t: +44 20 7585 2200   voip:
> sip:russel.winder@ekiga.net
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>
>

Mime
View raw message