Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to cancel Build
How to cancel Build [message #482059] Tue, 25 August 2009 09:53 Go to next message
encom79  is currently offline encom79 Friend
Messages: 12
Registered: July 2009
Junior Member
Hi

In my EarlyStartup plugin, I have a PRE_BUILD listener which does things,
but if these things failed, how to cancel the BUILD ?

Throw a runtine exception ?

This is the code to listen PRE_BUILD events.

ResourcesPlugin.getWorkspace().addResourceChangeListener(new
PreBuildProcess(), IResourceChangeEvent.PRE_BUILD);
Re: How to cancel Build [message #482168 is a reply to message #482059] Tue, 25 August 2009 14:54 Go to previous messageGo to next message
encom79  is currently offline encom79 Friend
Messages: 12
Registered: July 2009
Junior Member
Nobody have an idea ?
Re: How to cancel Build [message #482519 is a reply to message #482168] Wed, 26 August 2009 21:07 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi encom79,

What is the build you are talking about? Did you create your own builder or
are you talking about the java build? "When auto-build is turned on, all
installed builders will be invoked every time resources are added, removed,
or modified in the eclipse workspace". If you want to control the build
process you should disable the auto build and invoke the build when you see
fit in your resource change listener.

http://www.eclipse.org/articles/Article-Builders/builders.ht ml

To be able to better respond to your future questions I would recommend to be
more specific.

Best Regards,

Wim Jongman




> Nobody have an idea ?
Re: How to cancel Build [message #482643 is a reply to message #482519] Thu, 27 August 2009 12:45 Go to previous messageGo to next message
encom79  is currently offline encom79 Friend
Messages: 12
Registered: July 2009
Junior Member
This is simple.

Im using flex builder and i want to add a pre-build operation.

I have made a org.eclipse.ui.Startup plugin, and put the following line in
the earlyStartup() method :
ResourcesPlugin.getWorkspace().addResourceChangeListener(new
PreBuildProcess(), IResourceChangeEvent.PRE_BUILD);

This changeListener notify my PreBuildProcess that a build will run. I
works fine. But if something goes wrong in my pre-build process I want to
notify the build process to cancel but I dont know how to do that.

The ChangeListener contains this method void
resourceChanged(IResourceChangeEvent event) overridden by my
PreBuildProcess class. I errors occurs in my "resourceChanged" function I
tried to throw an OperationCanceledException but it does not works.
Re: How to cancel Build [message #482767 is a reply to message #482643] Thu, 27 August 2009 20:20 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi encom79,

I see. I really don't think that the build can be cancelled by a
resourcechangelistener. I don't see any explicit methods and I doubt that a
misbehaving listener can cancel the build. Want do you want to achieve? Why
is it so important to cancel the build?

Regards,

Wim


> This is simple.
>
> Im using flex builder and i want to add a pre-build operation.
>
> I have made a org.eclipse.ui.Startup plugin, and put the following line in
> the earlyStartup() method :
> ResourcesPlugin.getWorkspace().addResourceChangeListener(new
> PreBuildProcess(), IResourceChangeEvent.PRE_BUILD);
>
> This changeListener notify my PreBuildProcess that a build will run. I
> works fine. But if something goes wrong in my pre-build process I want to
> notify the build process to cancel but I dont know how to do that.
>
> The ChangeListener contains this method void
> resourceChanged(IResourceChangeEvent event) overridden by my
> PreBuildProcess class. I errors occurs in my "resourceChanged" function I
> tried to throw an OperationCanceledException but it does not works.
Re: How to cancel Build [message #482814 is a reply to message #482767] Fri, 28 August 2009 08:06 Go to previous messageGo to next message
encom79  is currently offline encom79 Friend
Messages: 12
Registered: July 2009
Junior Member
The aim is to trigger the "run" and "debug" button press :/
There is no PRE_RUN or PRE_DEBUG, PRE_BUILD is the best and simplest way I
have found to run my process before the "run/debug".

In this PRE_BUILD process I launch some executable (GUI) in a thread then
the regular BUILD start by launching Adobe Flex/Air program.
If my executable in the PRE_BUILD failed I should not let Adobe Flex/Air
program to run :/
That's why I need to find a way to kill Adobe Flex/Air program.
Re: How to cancel Build [message #484877 is a reply to message #482814] Wed, 09 September 2009 15:16 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Hi,

Can't you use the file modification hook? The file modification hook goes
into your checker which prevents the saving of the file which in turn will
not trigger the build.

Regards,

Wim

File modification validators
It's also possible that team repository providers will need to prevent or
intervene in the editing or saving of a file. The team plug-in accomplishes
this by using the extension point
org.eclipse.core.resources.fileModificationValidator to register a validator
that is called whenever a resource is to be modified.

<extension point="org.eclipse.core.resources.fileModificationValidator "
id="FileValidator">
<fileModificationValidator
class=" org.eclipse.team.internal.core.FileModificationValidatorMana ger "/>
</extension>
The supplied class must implement IFileModificationValidator, which is
called by the platform whenever a resource is saved or opened. The team
plug-in installs a file modification manager that can determine which team
provider is managing a resource and invoke its specific validator.



--
Best Regards,

Wim Jongman
http://www.remainsoftware.com
http://www.industrial-tsi.com
"encom79 " <encom79@hotmail.com> wrote in message
news:e1bc34802b26784facb3cf894cdfb434$1@www.eclipse.org...
> The aim is to trigger the "run" and "debug" button press :/
> There is no PRE_RUN or PRE_DEBUG, PRE_BUILD is the best and simplest way I
> have found to run my process before the "run/debug".
>
> In this PRE_BUILD process I launch some executable (GUI) in a thread then
> the regular BUILD start by launching Adobe Flex/Air program.
> If my executable in the PRE_BUILD failed I should not let Adobe Flex/Air
> program to run :/
> That's why I need to find a way to kill Adobe Flex/Air program.
>
>
Previous Topic:Dynamically change icon for a treeitem on a view
Next Topic:Composite Added; Resize Fails
Goto Forum:
  


Current Time: Fri Apr 26 03:25:00 GMT 2024

Powered by FUDForum. Page generated in 0.03963 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top