ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: ant problem under cygwin and questions from a wanna-be Makefile convert
Date Thu, 17 Oct 2002 05:12:59 GMT
--- Ralf Hauser <> wrote:
> a little summary
> > Can I use "?" inside ant? Or is there only mapper regex?
> Diane ( directed me to

I didn't think I did, but if I did, I didn't mean to. I meant to direct
you the the "Directory-based Tasks" section:

> > 3) how to show the content of a fileset?
> Diane says: <pathconvert> it to a property and <echo> the property.
> but I get the error:
> build.xml:14: Unexpected element "pathconvert" ??

<pathconvert> needs to be inside a <target>.

> > i) if there is a *.??.m4 file, run m4 on that file and create the
> > corresponding *.??.html output file unless it exists already
> Diane: See the last example on the Apply task page in the doc.
> ----
> This works with a batch script to circumvent the missing stdout
> redirection in ant or the missing ouputfile spec of gnu m4

Yeah, didn't know 'm4' didn't let you specify an output file -- guess it
expects you to be piping the output somewhere. Anyway, to avoid the batch
script, you could use the ant-contrib <foreach> and <if> tasks instead --
for example:
  <taskdef resource="net/sf/antcontrib/"/>

  <target name="doM4">
    <foreach target="runm4" param="">
      <fileset dir="${basedir}" includes="m4files/*.??.m4"/>

  <target name="runm4">
    <basename property="" file="${}" suffix=".m4"/>
    <dirname property="m4.dir" file="${}"/>
    <property name="m4.out" location="${m4.dir}/${}.html"/>
    <uptodate property="html.isUpToDate"
       targetfile="${m4.out}" srcfile="${}"/>
      <isset property="html.isUpToDate"/>
      <echo>${m4.out} is up-to-date.</echo>
      <echo>Processing ${}.m4 ...</echo>
      <exec executable="m4" output=${m4.out}>
        <arg value="-P"/>

Note: You will need to be running 1.5.1 to get the bug-fixed <basename>.



Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More

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

View raw message