Wait, wait ;-)
Have you tried Stefan's suggestion as-is?
>From your original shell script command, it sounds like you want to delete
all files ending in .??.html, and Stefan sent just that. So really try,
<delete>
<fileset dir=".">
<include name="**/*.??.html"/>
</fileset>
</delete>
which is the real equivalent to your:
<exec executable="${shCmd}">
<arg line='-c "rm *.??.html"'/>
</exec>
applied in all subdirectory of Ant's basedir.
Now, if that's not what you want to do, and want to delete only those
*.??.html files that have an equivalent *.m4 files, check out the <present>
selector, not the <depend> one you used.
It it's neither of what you want, please explain clearly in English which
files are to be removed, where, and especially why. Thanks, --DD
-----Original Message-----
From: Ralf Hauser [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 4:47 PM
To: Ant Users List
Subject: RE: splitting "arg line" into multiple "arg value"s fails? Unable
to execute command
thanks - I was just about to suggest a version of apply that doesn't add the
srcfile per default to the arguments:
<< <apply executable="myDel.bat" dir="." relative="true"
dest="." parallel="false">
<targetfile/>
<fileset dir="." includes="*.m4"/>
<mapper type="regexp" from="^([^\.]+)\.m4$$" to="\1.en.html"/>
</apply>
the myDel.bat batch file just drops the second argument >>
Now trying it with your recommendation (and the example in
http://www.mail-archive.com/[email protected]/msg16144.html).
<delete verbose="true">
<fileset dir="." includes="*.m4">
<depend targetdir=".">
<mapper type="regexp" from="^(.+)\.m4$$" to="*.en.html"/>
</depend>
</fileset>
</delete>
this unfortunately deletes the *.m4 instead of the *.html files, so I tried
(http://www.mail-archive.com/[email protected]/msg18388.html):
<dependset>
<srcfileset dir="." includes="*.m4">
<mapper type="regexp" from="^([^\.]+)\.m4$$" to="\1.en.html"/>
</srcfileset>
<targetfileset dir="." includes="*.en.html"/>
</dependset>
build.xml:96: The <fileset> data type doesn't support the nested "mapper"
element.
at
org.apache.tools.ant.IntrospectionHelper.createElementIntrospectionH
elper.java:521)
...
Any idea how this would work?
Many thanks in advance!
Ralf
> -----Original Message-----
> From: Stefan Bodewig [mailto:[EMAIL PROTECTED]]
>
> On Mon, 14 Oct 2002, Ralf Hauser <[EMAIL PROTECTED]> wrote:
>
> > Yes, I could use <delete>
> > if a) I could run delete
>
> You've got it backwards, <delete> already supports filesets:
[snip]
> will delete those files in a single path. Make yourself familiar with
> the selector stuff to get the most out of <fileset> once simple
> pattern matching is not enough.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>