Bug 17478 - [ExternalTools] Not all builders get run on incremental build
Summary: [ExternalTools] Not all builders get run on incremental build
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Ryan Cooper CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
: 17439 17642 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-23 16:06 EDT by Adam Schlegel CLA
Modified: 2002-09-18 13:58 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Schlegel CLA 2002-05-23 16:06:30 EDT
Build F1

When an incremental build occurs on a project, the first builder before the 
java builder, and the last builder after the java builder are the only External 
Tool builders that get run. All builders get run when a full build occurs.
Comment 1 Adam Schlegel CLA 2002-05-24 10:41:23 EDT
An auto-build seems to only invoke the first external tool on the list of tools 
to run. It doesn't matter how many other builders are defined, or whether the 
external tool comes before or after the java builder in the build order.
Comment 2 Simon Arsenault CLA 2002-05-29 12:17:27 EDT
Moving to Core for comments. Adam, could you provide a simple test case and 
steps to reproduce this?
Comment 3 Simon Arsenault CLA 2002-05-29 13:08:04 EDT
*** Bug 17642 has been marked as a duplicate of this bug. ***
Comment 4 Adam Schlegel CLA 2002-05-29 13:20:10 EDT
1) Create an empty project.
2) Add to it a file called build.xml containing the text:
    <project default="main">
      <target name="main">
        <echo message="${message}"/>
      </target>
    </project>
3) Add 4 builders to the project, all running build.xml. Call them first, 
second, third, and fourth respectively. Each builder should pass the argument -
Dmessage=name_of_current_builder. Put the java builder between "second" 
and "third".
4) Close the properties box. Notice that the build runs, and only "first" is 
printed.
5) Create a new java file, and compile it with an incremental build. Notice 
that "first" and "third" are printed.
6) Rebuild the entire project using Project->Rebuild Project. Notice that all 4 
messages get printed.
Comment 5 John Arthorne CLA 2002-05-30 10:21:31 EDT
Will fix.
Comment 6 John Arthorne CLA 2002-05-30 16:25:17 EDT
This is actually a feature ;)

On incremental builds, we avoid invoking a builder if no changes have happened 
since the last time it was called.  So, on the second invocation of the builder, 
it detects that nothing has changed, and skips it.

The fix that you guys should put in, is for your builder to call 
IncrementalProjectBuilder#forgetLastBuiltState() at any time during the build.  
This will discard the old state, so we will no longer be able to detect if 
anything changed since the last build.  This will cause your builder to be 
invoked every time.  The downside is that no deltas are received, but in the 
case of external tool builders, you aren't interested in deltas anyway.

Having said all that, we discovered a bug in forgetLastBuiltState() this week.  
I have released a fix to HEAD this afternoon, and it will be in the next build 
(>20020530).  It is still safe to call that method, but it will have no effect 
until this fix is available.

Moving back to UI (assigning to Adam, feel free to change if this isn't correct)
Comment 7 Ryan Cooper CLA 2002-05-31 11:30:11 EDT
*** Bug 17439 has been marked as a duplicate of this bug. ***
Comment 8 Nick Edgar CLA 2002-06-01 00:57:12 EDT
Change released.  Please verify.
Comment 9 Ryan Cooper CLA 2002-06-03 08:27:59 EDT
Build 20020602 (F2 candidate 2)

Fix verified.
Comment 10 Adam Schlegel CLA 2002-06-12 10:10:31 EDT
Works nicely in 20020611