ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wannheden, Knut" <K...@paranor.ch>
Subject ant task and filesets
Date Fri, 14 Dec 2001 12:17:34 GMT
Hi,

I am trying to set up an environment where a build needs to recurse over a
hierarchy of build units.  I am aware of the <configure> task on the
"external tools and tasks" page, but that's not exactly what I'm looking
for.

Since I'd like different targets (like build and clean) to recurse over the
same structure, it would be nice if the (relative) locations of a unit's
subunits could be captured in a fileset for instance.  No problem so far,
but then I'd like to be able to use this fileset with the <ant> task to call
the targets on the subunits recursively.  Unfortunately <ant> doesn't accept
filesets.

Is there a more general task, like the map function in functional languages,
that could assist me here, or does anybody have another suggestion?

The way I'm doing it now (build file for a specific unit with two subunits
'b' and 'c'):

 <target name="recurse">
  <ant dir="units/b" target="${recurse-task}"/>
  <ant dir="units/c" target="${recurse-task}"/>
 </target>

 <target name="compile" depends="init">
  <antcall target="recurse">
   <param name="recurse-task" value="compile"/>
  </antcall>
  <javac destdir="${build-dir}" srcdir="${src-dir}"/>
 </target>

This is a bit cumbersome and I'd like to be able to use the path structure
"units/b:units/c" in other places (such as classpath) as well.

Thanks,

Knut Wannheden.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message