ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject RE: Preserving URL paths in <apply> tasks
Date Thu, 14 Mar 2002 04:39:14 GMT
--- Jeff Lowery <jlowery@scenicsoft.com> wrote:
> > Is there some reason you're using <apply> with a <fileset>, 
> > when you only have the one file?  
> 
> Just using it as an example. Replace "generic.xs" with "*.xs" and you'll
> see where I'm going.

Gotcha. So okay, I don't think <apply>'s gonna do it for you. Since you're
not using a <mapper>, I assume you don't have a srcfile->targetfile
timestamp-checking need -- you just want to run them all through whenever
you do, right?  Assuming a "yes", I think you'll need to get the fileset,
convert that to a list of names the way you want them, then feed them
through <exec>, using either the ant-contrib <foreach> task or a <script>
task.

Here's using the <foreach> (which I can either send you, or you can pick
up from Sourceforge):
<project name="lowery" default="xsv2">

  <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

  <fileset dir="D:/xml/schemas" id="xsfileset">
    <include name="*.xs"/>
  </fileset>

  <target name="xsv2">
    <pathconvert pathsep="," dirsep="/" property="xsfiles"
                 refid="xsfileset">
      <map from="D:" to="file://d"/>
    </pathconvert>
    <foreach list="${xsfiles}" target="runXSV" param="xsfile"/>
  </target>

  <target name="runXSV">
    <exec executable="echo">
      <arg value="${xsfile}"/>
    </exec>
  </target>

</project>

I just used 'echo', since I don't have any XS files to use for real, but
you get the idea.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message