ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Critique my optional file copy target, please?
Date Tue, 05 Feb 2002 10:47:40 GMT
On Mon, 4 Feb 2002, Scott Ellsworth <> wrote:

> One way to do this is to sent compile.scr to the same as src, and to
> make the copy phase only do the delete and copy if it actually needs
> to.

> <target name="copy" depends="init" if="copy.needed">
>    <rmdir dir="${compile.source}"/ >

wouldn't that delete the "new" sources that follow your new layout or
is <rmdir> a shortcut for a task that knows which files to delete and
which to leave alone?

> 1.  Would it be better to do
> <target name="copy" depends="copy-setup" if="copy.needed">
> as then the no other target needs to be changed?

I think so - especially since the if attribute doesn't make any sense
unless the copy-setup target has been run, there is a logical
dependency between these two targets - much stronger than between your
copy-setup and the compile target IMHO.

> 2.  Is this the best way to handle this situation where two
> different layouts exist, and I really want to use the same set of
> targets for both layouts?

I don't think so - some creative use of multiple <src> elements in
<javac> or two separate <javac>s together with includes on the <javac>
task(s) seems better to me - don't copy sources at all.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message