We use the deleteAssociated task (relevant java code attached) written by my colleague Richard Hansen. We use it in our regular clean to remove java files generated from precompiling jsp's. We have java files that do not result from precompiled jsp's in the same directory, so simple delete **/*.java tasks would not work.
Here's an example on how we use it.
<target name="cleanjsp">
<deleteAssociated Filetype=".java" verbose="true">
<fileset dir="${webui.dir}/jsp" includes="**/*.jsp"/>
</deleteAssociated>
</target>
I hope it works for you.
Thanks
Donal
----- Original Message -----
From: "Gareth Thorburn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 01, 2002 8:17 AM
Subject: Re: Existing class file are not removed when the corresponding
source file is removed
>> Scenario.
>>
>> 0. build project
>> 1. somefile.java is removed.
>> 2. build project again.
>>
>> In this case, the corresponding somefile.class is not removed.
>>
>> I have found the same behaviour also occurs when using the optional
>> depend target.
>>
>> Does anyone have any solutions ?
>Write a "clean" target and call that reasonably frequently.
I hope you are meaning a 'clean' target which goes through and deletes
class files for which there is no longer a corresponding java source file.
If so could someone give me an example of such a target.
I hope you are not meaning a 'full' clean, which removes all class files. I
am
trying to avoid the need to perform a full rebuild everytime I sync my
project
with the source repository.
Gareth
--
Diese E-Mail enth�lt vertrauliche und/oder rechtlich gesch�tzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrt�mlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
DeleteAssociated.java
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
