ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Girard <>
Subject Re: Apply task and missing directories
Date Sun, 25 Jul 2004 14:30:00 GMT
On Wed, Jul 21, 2004 at 09:27:14AM -0500, Dominique Devienne wrote:
> Interesting. Sounds like you could do it with Ant-Contrib's <for> which can
> accept a <fileset> to iterate on (I think), then <dirname> to extract the
> directory, then Ant-Contrib's <propertyregexp> to simulate the mapper, then
> <mkdir> to create the re-parented directory name.
> Another option might be to use Ant-Contrib's <outofdate> with your fileset
> as source file, and a mapper that extracts either the target .png file, or
> if possible directly the target directory of the .png, and then does a <for>
> over these directories. In theory, we'd loop only over the directory you
> need to add, by extracting the out-of-date target files (with <outofdate>
> allows you to do).
> The last option is to write a <script>, which wouldn't be very difficult.
> A long time ago, I proposed (and used coded) allowing to pass a <dirset> to
> <mkdir>, but this wasn't accepted. If <mkdir> accepted a <dirset>,
with a
> nested mapper, then you'd have a ready made solution ;-)
> None of the above has been tested. Just my thoughts on what I'd try in your
> shoes. --DD
many thanks for your thoughts !

I examined the possible solutions, and it appeared that the key point is
to generate the png images in-place first, then moving them to the
desired directory, thereby using the ability of the <move> task to
create directories recursively on-the-fly.

For those who'd be interested, here's a general-purposed <dia2png>
macro, intended to be called against :
- a 'dir' directory containing dia diagrams, say:


- a 'todir' directory where the generated png images will take place:


The macro takes care of ignoring the diagrams that have not changed since the last generation.



                <macrodef name="dia2png">
                  <attribute name="dir"/>
                  <attribute name="todir"/>
                    <mkdir dir="@{todir}"/>
                    <apply executable="dia" dest="@{todir}">
                      <arg value="-e"/>
                      <fileset dir="@{dir}" includes="**/*.dia">
                      <mapper type="glob" from="*.dia" to="*.png"/>
                    <move todir="@{todir}">
                      <fileset dir="@{dir}">
                        <include name="**/*.png"/>
                <target name="GenerateImagesFromDiaDiagrams">
                    <dia2png dir="${}" todir="${}"/>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message