You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by marco struck <m....@nexolution.de> on 2000/12/19 13:06:12 UTC

user defined tasks

i would like to write an own task which use the nested tag <fileset>.

i took a look to the copy task.
there is the method

    public void addFileset(FileSet set);

i have also defined this method in my own task, but it doesn't work.
is that the right way or isn't it possible to use e.g. <fileset> tag ?



Re: user defined tasks

Posted by Sean Kelly <ke...@ad1440.net>.
> i would like to write an own task which use the nested tag <fileset>.

Here's how I did it:

---
public void addConvert(FileSet fs) {
       converts.addElement(fs);
}
private Vector converts = new Vector();
---

That let's me say in my build.xml file (for example):

---
<mytag ...>
  <convert dir="build">
    <include name="**/*.properties"/>
    <exclude name="**/*Test*"/>
  </convert>
  <convert dir="debug" includes="*Debug.class"/>
</mytag>
---

The <convert> tag is a fileset.

See the TiniAnt source for more details:
http://www.ad1440.net/~kelly/sw/tiniant/

--k