Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Ant custom task

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I could successfully write a custom task without using the nested elements.(without using the <innertask> in the ex. below)
However I am unable to write a custom task that contains nested element.
the task is :
<taskdef name="mytask" classname="customtask" />

<mytask srcdir="." destdir="../build" >
<innertask dir="c:\src" />
</innertask>
</mytask>
I need to get print(pass) the value of attribute dir in my customtask java file.

I shall be thankful if you could please write a code snippet or the steps for modifying the code when nested elements are used.
Thanks,
-Amol
 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you look at the source for the optional Telnet Ant task which has nested elements:
<telnet userid="bob" password="badpass" server="localhost">
<read>/home/bob</read>
<write>ls</write>
<read string="/home/bob"/>
</telnet>
Using this task as an example, I found it relatively easy to write nested Ant elements.
[ June 04, 2003: Message edited by: Jay Damon ]
reply
    Bookmark Topic Watch Topic
  • New Topic