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 <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]