Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Confused about Jobs and the auto build.
Confused about Jobs and the auto build. [message #252467] Mon, 14 June 2004 16:25 Go to next message
Eclipse UserFriend
Originally posted by: glongman.intelligentworks.nospam.com

Have a case where an editor may need to initiate (but not wait for) a build
of the project containing the resource.

How does one initate a build these days, but not if one is already running
on a particular project? And, how does it work if a build has been initiated
on one project and another editor needs to start one on a different project?

Been looking at the Job stuff, but I've gotten lost.

--
Geoff

Geoffrey Longman
Intelligent Works Inc.
Re: Confused about Jobs and the auto build. [message #252879 is a reply to message #252467] Tue, 15 June 2004 17:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

You don't have to do anything different for autobuild. If your plugin
modifies the workspace, then autobuild will occur soon afterwards in
another thread. you don't need to create a job or do anything explicit
to support this. If you are wondering about non-autobuild, that must
still be invoked explicitly using the same old API: IWorkspace.build and
IProject.build. In both cases, the workspace knows how to handle build
requests that happen after a build has already started (i.e., they are
queued and handled in order). Perhaps I don't understand what you are
trying to achieve.
--

G Longman wrote:
> Have a case where an editor may need to initiate (but not wait for) a build
> of the project containing the resource.
>
> How does one initate a build these days, but not if one is already running
> on a particular project? And, how does it work if a build has been initiated
> on one project and another editor needs to start one on a different project?
>
> Been looking at the Job stuff, but I've gotten lost.
>
Re: Confused about Jobs and the auto build. [message #253221 is a reply to message #252879] Wed, 16 June 2004 11:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: glongman.intelligentworks.nospam.com

Well, I guess I was *really* confused. Good news that I don't have to fiddle
with jobs.

A related question, if I initiate a project build that gets queued, what
happens if another request occurs? A second build?
Is there a way to check to see if a project build has been queued?

Geoff

"John Arthorne" <john@eclipsefaq.org> wrote in message
news:40CF655D.4050709@eclipsefaq.org...
> You don't have to do anything different for autobuild. If your plugin
> modifies the workspace, then autobuild will occur soon afterwards in
> another thread. you don't need to create a job or do anything explicit
> to support this. If you are wondering about non-autobuild, that must
> still be invoked explicitly using the same old API: IWorkspace.build and
> IProject.build. In both cases, the workspace knows how to handle build
> requests that happen after a build has already started (i.e., they are
> queued and handled in order). Perhaps I don't understand what you are
> trying to achieve.
> --
>
> G Longman wrote:
> > Have a case where an editor may need to initiate (but not wait for) a
build
> > of the project containing the resource.
> >
> > How does one initate a build these days, but not if one is already
running
> > on a particular project? And, how does it work if a build has been
initiated
> > on one project and another editor needs to start one on a different
project?
> >
> > Been looking at the Job stuff, but I've gotten lost.
> >
>
Re: Confused about Jobs and the auto build. [message #253252 is a reply to message #253221] Wed, 16 June 2004 12:34 Go to previous message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

I glossed over the details a bit. If you call IProject.build, the
request will be queued, and the caller will block until it is possible
for the build to proceed. This is how all resource-modifying operations
work (and have always worked). So yes, a second build will occur if you
call build() while a build is happening. With autobuild, it is smart
enough to only have one outstanding build queued at any given time. If
you make multiple changes to the workspace in a short period, the
autobuild job will keep getting added to the back of the queue. It is in
fact possible to find out if there is a build job occurring at any given
time. For autobuild:
Platform.getJobManager().find(ResourcesPlugin.FAMILY_AUTO_BU ILD);

For manual build:

Platform.getJobManager().find(ResourcesPlugin.FAMILY_MANUAL_ BUILD);

This second one only works if jobs that are performing builds
acknowledge that they belong to the build job family. This is true for
build jobs created by the platform, but may not be true for jobs created
by third party plugins that happen to perform builds. See the plugin
developer guide for more information on job families.
--

G Longman wrote:
> A related question, if I initiate a project build that gets queued, what
> happens if another request occurs? A second build?
> Is there a way to check to see if a project build has been queued?
>
> Geoff
>
> "John Arthorne" <john@eclipsefaq.org> wrote in message
> news:40CF655D.4050709@eclipsefaq.org...
>
>>You don't have to do anything different for autobuild. If your plugin
>>modifies the workspace, then autobuild will occur soon afterwards in
>>another thread. you don't need to create a job or do anything explicit
>>to support this. If you are wondering about non-autobuild, that must
>>still be invoked explicitly using the same old API: IWorkspace.build and
>>IProject.build. In both cases, the workspace knows how to handle build
>>requests that happen after a build has already started (i.e., they are
>>queued and handled in order). Perhaps I don't understand what you are
>>trying to achieve.
>>--
>>
>>G Longman wrote:
>>
>>>Have a case where an editor may need to initiate (but not wait for) a
>>
> build
>
>>>of the project containing the resource.
>>>
>>>How does one initate a build these days, but not if one is already
>>
> running
>
>>>on a particular project? And, how does it work if a build has been
>>
> initiated
>
>>>on one project and another editor needs to start one on a different
>>
> project?
>
>>>Been looking at the Job stuff, but I've gotten lost.
>>>
>>
>
>
Previous Topic:Key Binding for Run As > Application
Next Topic:Newbie: resource not mapped to a file?
Goto Forum:
  


Current Time: Fri Apr 25 08:00:02 EDT 2025

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

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

Back to the top