Bug 101481 - Building/cleaning projects in RAD does not work properly
Summary: Building/cleaning projects in RAD does not work properly
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: 1.3.0   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-23 11:56 EDT by Ricardo CLA
Modified: 2005-06-30 05:17 EDT (History)
0 users

See Also:


Attachments
web project to reproduce problem (3.33 KB, application/octet-stream)
2005-06-23 11:57 EDT, Ricardo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo CLA 2005-06-23 11:56:16 EDT
IDE: Rational Application Developer v6.0

Some of the problems described in this report were reported before (see BUG 
id=86941). At that time, the problems were fixed but now in the latest 
development build (as of 6/23/2005->1.2.1.20050623150852), the same problems 
and some new ones are present.

FYI: We have the "build automatically" feature off (we build our projects 
whenever we think is appropriate).

I will include an EAR file that you guys can import into the RAD workspace to 
reproduce the problem. It contains two projects: BuildEAR and BuildWEB. 
You can use the BuildWEB project to reproduce the problems described below.

The following works as expected when the project has just a WEB nature (does 
not have ASPECTJ nature):

If there are compilation errors in a project, and then you select that project, 
and "clean" the selected project (Project->Clean..), all compilation and 
WARNING errors for that project dissapear. The output folder is cleaned (in 
this case, the classes folder under the web-inf folder). The output folder is 
cleaned whenever you select to clean a project (regardless of having 
compilation errors or not).

If you select to "build" the project, then the output classes appear in the 
output folder (in this case, the classes folder under the web-inf folder). 
There is no need to 'Refresh' in order to see the compiled classes in the 
output folder.

However, if you convert the BuildWEB project to ASPECT nature, then above 
functionality is lost:

If there are compilation errors and/or WARNING errors in a project, and then 
you select that project, and "clean" the selected project (Project->Clean..), 
compilation errors and warnings DO NOT dissapear for that project. The output 
folder is NOT cleaned when you select to clean a project (regardless of having 
compilation errors or not); files are not deleted from the output folder.

If you select to "build" the project, the compiled classes DO NOT appear in the 
output folder (in this case, the classes folder under the web-inf folder). In 
order to see the compiled classes, you need to 'Refresh' the project. If you 
forget to 'Refresh' the project after building it, the application, of course, 
will not run (class not found errors will occur since RAD does not see the 
compiled files).
Comment 1 Ricardo CLA 2005-06-23 11:57:13 EDT
Created attachment 23870 [details]
web project to reproduce problem
Comment 2 Helen Beeken CLA 2005-06-24 04:18:55 EDT
Hi Ricardo,

Thanks for providing a simple project to use to reproduce this problem, which I
have been able to do.

The reason this behaviour is happening is that the fix for bug 86941 involved
providing an empty implementation of the clean(..) method. This is ok if when
you do Project > Clean you have the "start a build immediately" box checked.
However, if you don't then the behaviour you're seeing fits what we have.
Therefore, the fix is to do as in the javabuilder i.e. to clear all problem
markers, clear the state (something we can now do) and clear the output folder.
Comment 3 Helen Beeken CLA 2005-06-27 11:59:50 EDT
Hi Ricardo,

Just to let you know that the fix for this is on it's way and should be in a
development build sometime tomorrow. I'm just doing some final testing as this
is a sensitive area to put fixes in and I'll update this bug report when there's
a build available for you.

Thanks, Helen
Comment 4 Helen Beeken CLA 2005-06-28 08:28:25 EDT
This bug raises two issues: 

1) Clean doesn't remove .class files from output directory and doesn't remove
problems markers
2) when you choose to build after a clean then the .class files aren't there in
the output directory

Regarding (1) the fix and tests have been integrated and are available in build

BUILD COMPLETE -  build.432
Date of build: 06/28/2005 11:39:23
Time to build: 41 minutes 3 seconds
Last changed: 06/28/2005 11:22:58

which is available via the update site (see the downloads page for more
information: http://www.eclipse.org/ajdt/downloads )

The fix involved implementing the clean(..) method in AJBuilder to 

1) remove the incremental state
2) remove the error and problem markers for the selected project
3) clean the output folder

The test for this is in AJBuilderTest.

Leaving this bug open to look at the refreshing issue.

Thanks, Helen
Comment 5 Helen Beeken CLA 2005-06-28 11:52:35 EDT
The problem that in order to see the class files you had to manually refresh is
due to us doing some cleanup. We used to refresh the entire project after a
build (which is why the class files were being seen). However, this is quite
expensive and not always required. Therefore, unless there were dependent
projects we only refreshed the direct members (IResource.DEPTH_ONE). This, of
course, doesn't cover the various levels in the output directory.

The fix is to have an extra step where we refresh the output directory.

The manual builder test and fix have been integrated and are contained in build:

BUILD COMPLETE -  build.433
Date of build: 06/28/2005 14:55:06
Time to build: 38 minutes 20 seconds
Last changed: 06/28/2005 14:40:22

which is available via the update site (see the downloads page for more
information: http://www.eclipse.org/ajdt/downloads ).

I'm leaving this bug open to fix the final thing which is that when you do
Project > Clean on an AJ project, the output directory is cleared, but you have
to do a manual refresh to see the results.
Comment 6 Helen Beeken CLA 2005-06-29 10:58:22 EDT
The final fix and test have been integrated. When we clean the output folder
from a clean build, provided build automatically is off we do a refresh of the
output folder. We only do the refresh if build automatically is off because we
refresh anyway as part of the build.

The eclipse servers are overloaded by people downloading eclipse 3.1. This is
messing with our build system (as we do a cvs lookup for any changes).
Therefore, a good build containing this fix will probably not be available until
tomorrow. I'll update and close the bug when there's a build available.
Comment 7 Helen Beeken CLA 2005-06-30 05:17:28 EDT
There is a build now which contains the last fix:

BUILD COMPLETE -  build.436
Date of build: 06/30/2005 09:08:31
Time to build: 41 minutes 31 seconds

which is available via the update site (see the downloads page for more
information: http://www.eclipse.org/ajdt/downloads )

Therefore, closing this bug as fixed.