ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.kitt.rei...@gmail.com>
Subject Re: outofdate task returns TRUE if no target files exist??
Date Wed, 21 Jul 2010 09:16:42 GMT
The problem is that you are specifying no targetfiles.

In this case, I normally pick a scapegoat file that I know should
always be present. - ${destination}/myapp.ear/WEB-INF/web.xml
or some such file.

             <targetfiles>
               <fileset dir="${destination}/myapp.ear" includes="**/*"/>
               <path path="${destination}/myapp.ear/WEB-INF/web.xml"/>
             </targetfiles>


I suppose that one could change <outofdate> to always trigger if
there are no <targetfiles> as that is a common use case.

Peter


On Tue, Jul 20, 2010 at 8:35 PM, Marina <ppine7@yahoo.com> wrote:
> Hi, I wanted to see if the behavior I see when using the ant-contrib's
> 'outofdate' task is a correct one. Basically, I'm trying to determine if
> generated EAR archive (in the exploded form) has any out of date files in
> respect to the source directories, and re-copy those files if so.
> Here is my task:
>      <target name="check.ear.exploded.uptodate" >
>        <outofdate property="ear.not.uptodate">
>              <sourcefiles>
>                  <fileset dir="${build.jars}"
>                    includes="*.jar"/>
>                  <fileset dir="${build.wars}"
>                    includes="*.war"/>
>                  <fileset dir="${basedir}/rsrc/deployment"
>                    includes="application.xml"/>
>              </sourcefiles>
>              <targetfiles>
>                <fileset dir="${destination}/myapp.ear" includes="**/*"/>
>              </targetfiles>
>              <sequential>
>                <echo message="exploded myapp.ear dir is not uptodate -
> rebuilding"/>
>            </sequential>
>        </outofdate>
>      </target>
>
> Now, if there are no files in the "${destination}/myapp.ear" directory yet (I'm
> building for the first time after cleanup) - the outofdate task still returns
> TRUE. Needless to say, I would prefer the opposite behavior - if no target files
> exist - consider them out-of-date.
> Is this the expected behavior or am I missing something?
> Also, I hope this is the right forum to post this question to; if not - please
> let me know.
>
> Thanks!
> Marina

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


Mime
View raw message