On Tuesday, February 5, 2002, at 09:00 AM, Scott Ellsworth wrote:
> On Tuesday, February 5, 2002, at 02:47 AM, Stefan Bodewig wrote:
>
>> On Mon, 4 Feb 2002, Scott Ellsworth <[EMAIL PROTECTED]> wrote:
>>
>>> <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?
>
> The copy.needed property should only be set for the old sources.
Regrettable, my original copy-setup task was written as:
<target name="copy-setup" depends="init">
<condition property="copy.needed" >
<equals arg1="${compile.src}" arg2="${src}" />
</condition>
</target>
which sets the property copy.needed only if src and compile.src were the
same. This is exactly the case where we do NOT want such a beast set.
Thus, Stefan was right in the original letter, and this should either be
wrapped with a not tag:
<target name="copy-setup" depends="init">
<condition property="copy.needed" >
<not>
<equals arg1="${compile.src}" arg2="${src}" />
</not>
</condition>
</target>
and the copy target used as written, or the copy-setup target should not
be changed, but the property should be named "copy.superfluous", and the
copy target should be written
<target name="copy" depends="copy-setup" unless="copy.superfluous">
<rmdir dir="${compile.source}"/ >
<copy ... />
</target>
In other words, the assumption
> Assuming my copy-setup target properly does not set it for projects in
> the new layout, the entire copy target will not happen for a new layout
> project because of the if.
was exactly backwards.
Thanks for the warning - I would not have been happy hunting through my
empty directories for my source ;-) .
Scott
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>