Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » how to wait for WorkSpace.build() ?(build workspace)
how to wait for WorkSpace.build() ? [message #1445272] Wed, 15 October 2014 08:01 Go to next message
kurt Mising name is currently offline kurt Mising nameFriend
Messages: 15
Registered: July 2009
Junior Member

I need to wait for the workspace to be fully ready again to do tasks dependent on the outputfolders of the projects.

At the moment my code looks about like this:

// --- to re-create all outputfolders
workspace.build(clean,monitor);
// --- do the build
workspace.build(full,monitor);
// --- refresh all project
for(iproject p: projects)
p.refresh(infinte);
// --- wait for the build (triggered by refresh ?)
jobmanager.join(family_...);
// --- my dependent tasks
doMyTasks();

The problem now is, the jobmanager does not wait for auto-build triggered in background by the build/refresh.

Is there another way to wait for the auto-building ?

Eclipse:
Version: Luna SR1 (4.4.1)
Build id: M20140925-0400

Any help is very much welcome!

Thanks
Kurt
Re: how to wait for WorkSpace.build() ? [message #1447165 is a reply to message #1445272] Fri, 17 October 2014 22:15 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1828
Registered: July 2009
Senior Member
This approach looks OK to me - we use the same jobmanager.join(..) in JDT tests.

You have builders that directly write files, bypassing the resources API?
Otherwise the refresh should be a no-op and not trigger any building, right?

Perhaps the Eclipse Platform gurus have more insight into this.
Stephan
Re: how to wait for WorkSpace.build() ? [message #1476829 is a reply to message #1447165] Mon, 17 November 2014 11:36 Go to previous message
kurt Mising name is currently offline kurt Mising nameFriend
Messages: 15
Registered: July 2009
Junior Member
In my test-workspace there is no extra-builder.

But finally after a lot of trial an error,
I found a working solution for me:

In workspace-modify-operation:

* autobuild off
* add/replace from CVS and/or delete projects
* build(clean)
* build(full)
* build(incremental)
* refresh all projects
* autobuild on

After workspace-modify-operation:

* wait for decorator-job to finish
(sometimes auto-build starts again while waiting
for the decorator job ... why ???)

Only after that "procedure" I can be more or less sure,
that everything is in a reproducable state and I can
do "myWork()".

The combination of build(full) / build(incremental)
seems to do (almost) all the expected build-work -
full-build alone does not.

Incremental build lasts abt. 10 times more then
the previously called full-build.

If a full-build should do everything (FULL),
incremental-build should be a no-op - am I wrong with that ?

If full-build is broken, maybe or not the problems reported
in 448997 and 424222 are somehow related to that behavior ?

... at least I found a solution for my simple plugin.

Thanks
Kurt
Previous Topic:Can a Java program contain its own debugger?
Next Topic:Apache felix GoGo shell doesn't work, can't read commands properly
Goto Forum:
  


Current Time: Fri Nov 27 18:54:32 GMT 2020

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

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

Back to the top