How should an Ant <fileset> be created programmatically from another (custom) Ant task?

Christopher BROWN <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <CAHL_zcNMGTdO0RZ1q14phsCo+GhA_ZSbO7AxzxA9WC6rR7hMFw@mail.gmail.com>
Hello,

I've developed a few custom Ant tasks over time, but I need a little help
doing something specific to Ant's data types.  I've created a task that
retrieves a set of files from a server, but the names aren't known in
advance, they're determine during execution of the task.  I'd like to
create a fileset that has an ID and can be referred to later on by other
tasks and targets in the build.

This is how I assumed I'd get started:

FileSet fs = new FileSet();
fs.setId("someid");
fs.setProject(_project_);
fs.setDir(_dir_);
fs.createInclude().setName("entry/within/dir1/containing/file.abc");
fs.createInclude().setName("entry/within/dir2/containing/file.xyz");

I've some doubts about the "createInclude" logic... but I haven't got that
far yet.  I'm stuck on the "setId()" part which just doesn't exist.

In a build script, I'd write:

<fileset id="someid" dir="somedir">
  <include name="relative/path/to/file" />
</fileset>

... then refer to it later with "refid".

How can I get this to work?

Thanks,
Christopher
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.