ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: How to determine if files in a fileset are up to date?
Date Fri, 05 Dec 2003 10:55:29 GMT
Dirk Schnelle wrote:

>Hi,
>
>I have a java preprocesser and want to check if has already done it's work.
>
>The preprocessor source files are stored in my source code folder. The result is written
to another directory which serves as an input for the java compiler.
>
>I tested uptodate with
>    <uptodate property="preprocessNotRequired">
>      <srcfiles dir= "${src}" includes="**/*.oj"/>
>      <mapper type="glob" from="${src}*.oj" to="${build}*.java"/>
>    </uptodate>
>  
>
You (I think) need to change this to:

    <uptodate property="preprocessNotRequired">
      <srcfiles dir= "${src}" includes="**/*.oj"/>
      <mapper type="glob" from="*.oj" to="${build}/*.java"/>
    </uptodate>

Example:

 <target name="oj">
    <property name="src" location="src"/>
    <property name="build" location="preprocess"/>
    <touch file="src/task/x.oj"/>
    <uptodate property="preprocessNotRequired">
      <srcfiles dir= "${src}" includes="**/*.oj"/>
      <mapper type="glob" from="*.oj" to="${build}/*.java"/>
    </uptodate>
    <mkdir dir="preprocess/task"/>
    <touch file="preprocess/task/x.java"/>
    <uptodate property="preprocessNotRequired2">
      <srcfiles dir= "${src}" includes="**/*.oj"/>
      <mapper type="glob" from="*.oj" to="${build}/*.java"/>
    </uptodate>
    <echo>preprocessNotRequired is ${preprocessNotRequired}</echo>
    <echo>preprocessNotRequired2 is ${preprocessNotRequired2}</echo>
  </target>

results in

oj:
     [echo] preprocessNotRequired is ${preprocessNotRequired}
     [echo] preprocessNotRequired2 is true

Peter

>It works if up2date can find the destination files, but sets preprocessNotRequired to
true if the files aren't present (after a call to clean).
>The preprocessor source files are located in several directories.
>
>How can I tell uptodate that a file is not up to date if it is not present?
>
>A better approach for me would be to determine a fileset containing only all the files
that are not up to date. How can I manage this.
>
>I am using ant 1.5.4.
>
>/Dirk
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>


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


Mime
View raw message