Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Sometime the POST_BUILD event is not fired properly
Sometime the POST_BUILD event is not fired properly [message #320400] Wed, 19 September 2007 17:26 Go to next message
Eclipse User
Originally posted by: ku_long.hotmail.com

Hey,

In our plug-in we are using our own compiler to
build the project, thus, I have some code to do
something to clean our compiler when an eclipse
build action is completed. I put those code in
a resource change listener which listen to the
POST_BUILD event.

My test case is:
1. Turn on "Automatically Build" function;
2. Click Project-->Clean menu function;

Expected result is:
1. Do clean and a POST_BUILD event is fired and
its build kind is "CLEAN_BUILD".
2. Do automatic build; IncrementalProjectBuilder.build()
of each project is called; a POST_BUILD event
is fired and its build kind is "AUTO_BUILD" (or
INCREMENTAL_BUILD).

My problem is, sometime I got both step 1, 2 done
correctly; sometime I just got step 1 done correctly,
and for step 2, I observed that my implementation of
IncrementalProjectBuilder.build() is called for each
project but a POST_BUILD event is not fired at the end.

Thanks.

Raymond
Re: Sometime the POST_BUILD event is not fired properly [message #320414 is a reply to message #320400] Thu, 20 September 2007 13:44 Go to previous messageGo to next message
Eclipse User
Originally posted by: ku_long.hotmail.com

I did more test today and still got the same thing.
I added PRE_BUILD event to my resource listener.
When I click the "Project--> Clean", sometime I got:

PRE_BUILD (build kind: CLEAN_BUILD)
IncrementalProjectBuilder.clean() (project1)
IncrementalProjectBuilder.clean() (project2)
...
POST_BUILD(build kind: CLEAN_BUILD)
IncrementalProjectBuilder.build() (project1)
IncrementalProjectBuilder.build() (project2)
...

sometime I got:
PRE_BUILD (build kind: CLEAN_BUILD)
IncrementalProjectBuilder.clean() (project1)
IncrementalProjectBuilder.clean() (project2)
...
POST_BUILD(build kind: CLEAN_BUILD)
PRE_BUILD (build kind: AUTO_BUILD)
IncrementalProjectBuilder.build() (project1)
IncrementalProjectBuilder.build() (project2)
...
POST_BUILD (build kind: AUTO_BUILD)

The second situation is what I desire.
Every time, the clean function is completed correctly.
But I don't know why sometime eclipse does not fire the
PRE_BUILD (build kind: AUTO_BUILD) and
POST_BUILD (build kind: AUTO_BUILD) events.

Thanks.
Re: Sometime the POST_BUILD event is not fired properly [message #320459 is a reply to message #320414] Fri, 21 September 2007 13:34 Go to previous messageGo to next message
Eclipse User
Originally posted by: ku_long.hotmail.com

Anyone knows the answer? :-)
Re: Sometime the POST_BUILD event is not fired properly [message #320465 is a reply to message #320459] Fri, 21 September 2007 21:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: eclipseng.arthorne.com

No clue... The PRE_BUIID and POST_BUILD events should occur quite
reliably. You could try putting a breakpoint in AutoBuildJob.doBuild,
and step through the lines that fire the build events before and after
the build... (make sure org.eclipse.core.resources plugin is on your
search path - you can do this from the Plug-ins view).
--

Raymond wrote:
> Anyone knows the answer? :-)
>
>
Re: Sometime the POST_BUILD event is not fired properly [message #320571 is a reply to message #320465] Mon, 24 September 2007 11:01 Go to previous messageGo to next message
Eclipse User
Originally posted by: ku_long.hotmail.com

John Arthorne wrote:

> No clue... The PRE_BUIID and POST_BUILD events should occur quite
> reliably. You could try putting a breakpoint in AutoBuildJob.doBuild,
> and step through the lines that fire the build events before and after
> the build... (make sure org.eclipse.core.resources plugin is on your
> search path - you can do this from the Plug-ins view).
> --

John, thanks for you suggestion. I did some debug on this issue and found
that after cleaning, PRE_BUILD event is fired, but in method
NotificationManager.broadcastChanges(), delta.getKind() returns 0,which
means there is no change; Thus, the event is not broadcasted. We have our
implementation of IncrementalProjectBuild. I am wondering should I do
something in the IncrementalProjectBuild.clean() to let eclipse think the
delta is changed?

Thanks.
Re: Sometime the POST_BUILD event is not fired properly [message #320637 is a reply to message #320571] Tue, 25 September 2007 09:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: ku_long.hotmail.com

Need help!:-)
Re: Sometime the POST_BUILD event is not fired properly [message #320668 is a reply to message #320571] Wed, 26 September 2007 11:27 Go to previous messageGo to next message
Eclipse User
Originally posted by: ku_long.hotmail.com

I think I might missed something in my clean method.
Does anyone know what I should do to let eclipse think
the delta is changed?
Re: Sometime the POST_BUILD event is not fired properly [message #320682 is a reply to message #320668] Wed, 26 September 2007 16:15 Go to previous message
Eclipse User
Originally posted by: wharley.bea.com

"Raymond" <ku_long@hotmail.com> wrote in message
news:8cd6334c45798db2f60e1c52b04ab172$1@www.eclipse.org...
>I think I might missed something in my clean method.
> Does anyone know what I should do to let eclipse think the delta is
> changed?

Is it possible that you're changing resources directly (e.g. with
java.io.File) rather than through the IResource APIs? If so, you'd need to
do a RefreshLocal in order for Eclipse to find out about the changes in
time.
Previous Topic:using a view in a swt control
Next Topic:How do I find out why a plugin is not beeing loaded?
Goto Forum:
  


Current Time: Fri Aug 29 14:37:57 EDT 2014

Powered by FUDForum. Page generated in 0.01745 seconds