Russel Winder wrote:
I find using strings as identifiers somewhat infelicitous -- I like
having language level symbols so as to avoid spelling error issues.
Also for me, strings are data not control.

So as a specific single example, I don't like having to use strings for
task names, as in:

        defaultTasks ( 'flob' , 'adob' )

However, whilst task names were string everywhere I just got into the
habit of:

        def flob = 'flob'
        def adob = 'adob'
. . . defaultTasks ( flob , adob ) But now that task names are not strings in some places whereas they are
in others, things are getting to a "point of pain".

        task printHelloWorld << {
          println ( 'Hello World.' )
        }
defaultTasks ( 'printHelloWorld' )

Is annoying me because the name of the task is not the same sort of
language structure everywhere.  Am I on my own here?  Have I missed
something?  Is there something to think about?


Probably. The defaultTasks() method should probably accept exactly the same things as parameters that Task.dependsOn() does. Then, you could do:

task hello ...

defaultTasks hello
defaultTasks 'hello'
defaultTasks [hello]
defaultTasks { tasks.findAll { it.name == 'hello' } }


Adam


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

   http://xircles.codehaus.org/manage_email


Reply via email to