This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 56619 - "Clean all" deletes source files if build path is same as source path
Summary: "Clean all" deletes source files if build path is same as source path
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-17 22:28 UTC by cayac
Modified: 2011-08-31 14:05 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cayac 2005-03-17 22:28:46 UTC
In order to get back the 3.x behaviour where compiled classes were placed in the 
source code directory, I changed "build.classes.dir" and "build.dir" to the 
source directory. Executing "Clean and Build (Shift-F11)" resulted in all files 
in the source code directory being lost.

Perhaps the build process should only delete files that can be compiled by it.
Comment 1 Jesse Glick 2005-03-18 00:29:59 UTC
Duplicate of something? Not sure.
Comment 2 Tomas Zezula 2005-04-07 13:15:47 UTC
This is not supported case. The build directory has to differ to the source
root. In the NetBeans 4.1 there are more source roots in the single compilation
unit, so build dir == src.dir does not work at all.
Comment 3 Milan Kubec 2005-04-07 14:10:22 UTC
Changing to Enhancement, because I think that it could happend to somebody who
is used to compile to source dir. There might be some test that would disable
clean actions if those two properties point to the same folder or something like
that.
Comment 4 cayac 2005-04-21 12:02:32 UTC
If you have to work together with Eclipse users via CVS/SVN you either have to 
compile to the source dir or have to copy all media files referenced in your 
classes from the source dir to the build dir every time you check out. At least 
I found no other solution. So compiling to source dir should be an option. 
Comment 5 Tomas Zezula 2005-04-21 12:20:19 UTC
Eclipse cannot do compilation to build directory?
OK, it is possible to do it in NetBeans (needs to rewrite the clean target), but
it will look strange.
Comment 6 cayac 2005-04-21 12:30:44 UTC
Maybe Eclipse can compile to build dirs, but the developers I know (and work 
with) compile to the source dir. I prefer seperate build dirs, too, but don't 
want to hassle around with copying files forth and back when working with 
Eclipse users.
Imho the Clean target should never delete files which are not built by Netbeans. 
 Limiting it to class (and other?) files would be safer. Perhaps it should only 
include class files with corresponding source files. This would prevent one from 
deleting third-party classes in the build dir which won't be built by Netbeans. 
I'm wondering why I'm the only one affected by this behaviour.
Comment 7 Tomas Zezula 2005-04-21 13:01:44 UTC
Most of users are using separated src and build dir. The most Ant script's clean
target simply deletes the build folder. Deleting only class files which were
compiled from the java files will need a custom ant task. It is problematic for
users which require headless build (eg. automatic builds)