ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: <apply executable> question
Date Fri, 30 Jan 2004 22:02:58 GMT
--- Stefan Bodewig <bodewig@apache.org> wrote:
> On Fri, 23 Jan 2004, Matt Benson
> <gudnabrsam@yahoo.com> wrote:
> > (from the manual), then, in our hypothetical
> "output files can be
> > mapped per source file" implementation, using the
> same <mapper> for
> > target files and output files alike?
> 
> Yes so far - with the tiny exception that it won't
> work for timestamp
> comparisons as the output will already be open then,
> in the current
> infrastructure, that is.
> 

Stefan:  I checked the code and found that Redirector
uses LazyFileOutputStreams... so timestamp comparisons
should be okay, as illustrated by this test buildfile:

<?xml version="1.0"?>
<project name="test apply" basedir="."
default="apply">

  <fileset id="myfs" dir="${basedir}"
includes="in1,in2,in3" />

  <pathconvert property="do-not-create" pathsep=" "
setonempty="false">
    <path>
      <fileset refid="myfs" />
    </path>
  </pathconvert>

<!--use non-empty files to make sure the output file
gets written-->
  <target name="create" unless="do-not-create">
    <echo file="in1" message="x" />
    <echo file="in2" message="y" />
    <echo file="in3" message="z" />
  </target>

  <target name="apply" depends="create">
    <apply executable="cat" output="out"
dest="${basedir}" append="true">
      <fileset refid="myfs" />
      <mapper type="merge" to="out" />
    </apply>
  </target>
  
  <target name="touch">
    <touch>
      <fileset refid="myfs" />
    </touch>
  </target>
  
  <target name="clean">
    <delete>
      <fileset refid="myfs" />
      <fileset file="out" />
    </delete>
  </target>

</project>

compare the results of "ant -v" vs. "ant -v touch
apply".  I think this portion of what we were talking
about is a non-issue.

-Matt

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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


Mime
View raw message