<define> task for NAnt

roger's picture

Essentially, you write a new task like this:

<define name="echo3">
  <echo message="${this.message}"/>
  <echo message="${this.message}"/>
  <echo message="${this.message}"/>
</define>

...and then you call it like this:

<echo3 message="Hello World"/>

Any parameter passed to the defined task is available as this.foo inside the defined task. I've found it useful when you don't want to write a task in C#, perhaps because all you're doing is calling a bunch of other NAnt tasks.

Comments

Have you tried to rebuild

Have you tried to rebuild this with NAnt 0.86? It seems that the TaskBuilder class is now internal and so this code won't build.

NAnt 0.86

No. I've not tried with 0.86. I'm unlikely to get a chance any time soon, unfortunately.

Ok thanks. If I manage to

Ok thanks. If I manage to get it working I will post an update.

I've raised a bug report

Raised as #2782705 on SourceForge

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.