ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject RE: Existing class file are not removed when the corresponding source file is removed
Date Mon, 04 Mar 2002 01:08:28 GMT
Gareth,

Fundamentally this is hard to do, in general. Consider this code

public class Test {
    public static final void main( String[] args ) {
        Hidden hidden = new Hidden();
        System.out.println("Hey there, World.");
    }
}

class Hidden {

}


It generates a class file Hidden.class for which there is no Java file. If
you delete Hidden.class Ant will not know Test.java needs to be recompiled.
That is not good. If you compile without debug, there is not even an
indication in the class file about which source file produced this class.
This is why <depend> will not remove such classes.

It may be possible to chnage <depend> to examine the sourcefile attribute if
you do include debug info and remove the file if the java file is not there.
I'll have a look at that.

Conor


> -----Original Message-----
> From: Gareth Thorburn [mailto:gareth.thorburn@db.com]
> Sent: Saturday, 2 March 2002 12:44 AM
> To: ant-user@jakarta.apache.org
> Subject: Existing class file are not removed when the corresponding
> source file is removed
>
>
> Hi,
>
> 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 ?
>
>
> 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:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message