Community
Participate
Working Groups
Build Identifier: 20110615-0604 Eclipse doesn't invoke Ant builder after a clean even if the builder is configured accordingly. Note: Project->Build Automatically is checked. Reproducible: Always Steps to Reproduce: 1. Import sample project (attached) 2. Open the Console view 3. Invoke Project->Clean... and select the "test-bug-ant-build-trigger" project 4. The console doesn't show the message from the script.
Created attachment 199681 [details] a sample project exhibiting the problem
*** Bug 351744 has been marked as a duplicate of this bug. ***
*** Bug 200204 has been marked as a duplicate of this bug. ***
(In reply to comment #2) > *** Bug 351744 has been marked as a duplicate of this bug. *** Not related. Ant is invoked under bug 351744. Invoking Ant throws a Java exception that hangs Eclipse operation. If Ant weren't invoked, there'd be no error complaining that a main class couldn't be found for Ant.
'After a "Clean"' in the Targets tab really means "Before a build which happens after a clean". We need to change the wording.
(In reply to comment #5) > 'After a "Clean"' in the Targets tab really means "Before a build which happens > after a clean". We need to change the wording. Agreed but the problem remains.
(In reply to comment #6) The behavior has changed because of the change in the way the build is getting trigged from platform/resources. Look at bug 306746. We need to see what is the best way to go for ant builder.
Created attachment 209428 [details] Proposed patch Patch to fix this issue. Added the trigger even for AUTO_BUILD and when the build is called, the build is filtered off if it is not really full build. I haven't written tests yet for this. I will do so. There is one issue with this patch. For the existing builders to work, one has to go to the UI, look at the targets and click OK.
Created attachment 209568 [details] Patch in consideration This patch also tries to migrate the old builders. There are still no tests added.
Do we really need migration for old builders? Doing this silently behind the scenes when the user edits a builder and then clicks OK doesn't sound right. There's no visible change in the UI, and the change in the .launch file is this additional line: <intAttribute key="org.eclipse.ui.externaltools.ATTR_VERSION" value="1"/> That's very confusing. The expected behavior should just work out of the box, without any configuration change. Bug 340864 has recently documented the expected behavior, and that matches the expectation in comment 0: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-93a_project_builder_targets.htm
(In reply to comment #10) > Bug 340864 has recently documented the expected behavior, and that matches the > expectation in comment 0: > http://help.eclipse.org/indigo/index.jsp? topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-93a_project_builder_targets.htm The documentation says 'After clean' will trigger the builder irrespective of the 'Build Automatically' status. However, with the change in bug 306746, this no longer works. > Do we really need migration for old builders? To fix this, this builder has to be registered for 'auto build' too. That way the new builders can be fixed, but the old builders have to be migrated to support this :(. > > Doing this silently behind the scenes when the user edits a builder and then > clicks OK doesn't sound right. There's no visible change in the UI, and the > change in the .launch file is this additional line: > <intAttribute key="org.eclipse.ui.externaltools.ATTR_VERSION" value="1"/> > > That's very confusing. The expected behavior should just work out of the box, > without any configuration change. The real change actually goes into the .project file with the builder's getting registered for auto too. The version number is being stored to avoid checking every time. Migration of the launch configuration can actually be avoided, but the .project file will have to get updated :(.
Oh, I missed the builder changes in .project. So bug 306746 was in fact a breaking change that has not been mentioned in the migration guide for 3.7. Unless bug 306746 gets reverted and fixed in a compatible way, I guess the Ant support indeed doesn't have another choice than to migrate existing builders.
(In reply to comment #12) > Unless bug 306746 gets reverted and fixed in a compatible way, I guess the Ant > support indeed doesn't have another choice than to migrate existing builders. An alternative would be to simply fix the CleanDialog as proposed in patch 1 on the bug, to prompt the user to rebuild the cleaned projects: https://bugs.eclipse.org/bugs/attachment.cgi?id=162699 This is both easy, safe, and gives the user full control. (There was some pushback against this, instead a request was made to make the dialog more featureful, which hasn't happened.)
Observed same behaviour, from time to time, with Version: 3.6.2 Build id: M20110210-1200 on Windows XP. Currently stuck into this problem with a project. Cleanup performed when upgrading compiler compliance level from 1.5 to 1.6. Needing help. regards
Fixed account details. Massimo Roscio Milano, Italy
Hello, This problem still remains in Juno SR2. This is very annoying... Situation (from my "user" point of view): ----------------------------------------- I'm using an Ant script to generate an additional Java file. The class in this file is reference by the rest of my project. This generated file is deleted upon clean (and it should be). The consequence is that after a clean the whole subsequent build fails because the generated file is absent because (due to the BUG) Eclipse does not call my Ant builder after the Clean (even though it is set up as such). One possible work-around I tried is to make the Ant builder also run upon Auto builds. However, this causes an endless building loop because my Ant builder is also set up to make refresh the project folder. Which means the auto build is retriggered due to the newly generated file. A work-around which does work, but is highly counter-intuitive is to make my Ant script run DURING the clean. Which causes my file to be regenerated right after it was deleted by the clean operation. Given that bug is almost 2 years old I truly hope it will be fixed in new Eclipse release in the near future.
Correction: the 2nd work-around I mentioned only works every 2nd time! Please fix the bug in Eclipse itself or post a working work-around for users...
I just tried the sample project with Photon Release (4.8.0), and as far as I can tell, the problem still exists. We also have an external builder that's not running after a clean. It's not an Ant builder, but simply runs a Bash script. This appears to be a recurring problem: https://bugs.eclipse.org/bugs/show_bug.cgi?id=87697 https://bugs.eclipse.org/bugs/show_bug.cgi?id=206540 and it would help our work if it were fixed.
(In reply to Glenn Burkhardt from comment #18) > I just tried the sample project with Photon Release (4.8.0), and as far as I > can tell, the problem still exists. We also have an external builder that's > not running after a clean. It's not an Ant builder, but simply runs a Bash > script. > > This appears to be a recurring problem: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=87697 > https://bugs.eclipse.org/bugs/show_bug.cgi?id=206540 > > and it would help our work if it were fixed. If you need the fix, the best thing you can do is to provide a patch. See https://wiki.eclipse.org/Platform_UI/How_to_Contribute
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.