Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to build and wait IProject.build()?
How to build and wait IProject.build()? [message #336529] Fri, 19 June 2009 08:48 Go to next message
Eclipse UserFriend
Hi!

I have an IJavaProject and I would like to build it and wait for the compiler to
generate the necessary class files. I have tried the following solution:


final IProgressMonitor monitor = new IProgressMonitor() {
boolean isDone = false;

@Override
public void done() {
if (!isDone) {
isDone = true;
// doing the post-compilation stuff here
}
}
};

project.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );


My problem is that in some cases done() is called several times. Ok, I've
introduced that isDone flag, and the handler code is executed only after the
first call (hope it's right this way).

However, it seems the class files I require are not exists when done() is
called. What am I doing wrong? Any suggestions how to deal with this?

Checking how many times done() is called and executing the code then would
obviously a nightmare, and ain't sure if it would even work.

(I want to compile the java files in the project and put them into a jar.
However, some of the class files are always missing or they are partially
compiled in the generated jar).

Thanks in advance,
---
Richard O. Legendi, programmer
AITIA International Inc.
E-mail: rlegendi@aitia.ai
Re: How to build and wait IProject.build()? [message #336534 is a reply to message #336529] Sat, 20 June 2009 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Richard,

There was a bug in one of the older Galileo drivers where the build
didn't complete by the time the call to build return, but that should be
fixed now. Which version of Eclipse are you using?


Richard O. Legendi wrote:
> Hi!
>
> I have an IJavaProject and I would like to build it and wait for the
> compiler to generate the necessary class files. I have tried the
> following solution:
>
>
> final IProgressMonitor monitor = new IProgressMonitor() {
> boolean isDone = false;
>
> @Override
> public void done() {
> if (!isDone) {
> isDone = true;
> // doing the post-compilation stuff here
> }
> }
> };
>
> project.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );
>
>
> My problem is that in some cases done() is called several times. Ok,
> I've introduced that isDone flag, and the handler code is executed
> only after the first call (hope it's right this way).
>
> However, it seems the class files I require are not exists when done()
> is called. What am I doing wrong? Any suggestions how to deal with this?
>
> Checking how many times done() is called and executing the code then
> would obviously a nightmare, and ain't sure if it would even work.
>
> (I want to compile the java files in the project and put them into a
> jar. However, some of the class files are always missing or they are
> partially compiled in the generated jar).
>
> Thanks in advance,
> ---
> Richard O. Legendi, programmer
> AITIA International Inc.
> E-mail: rlegendi@aitia.ai
Re: How to build and wait IProject.build()? [message #336542 is a reply to message #336534] Mon, 22 June 2009 02:44 Go to previous message
Eclipse UserFriend
Hi Ed!

Thanks for the reply. I'm using this build of Eclipse:

Version: 3.4.2
Build id: M20090211-1700

I guess it's a new version so I'll search the Bugzilla for this issue, thanks
for pointing it out.

Richard

Ed Merks wrote:
> Richard,
>
> There was a bug in one of the older Galileo drivers where the build
> didn't complete by the time the call to build return, but that should be
> fixed now. Which version of Eclipse are you using?
>
>
> Richard O. Legendi wrote:
>> Hi!
>>
>> I have an IJavaProject and I would like to build it and wait for the
>> compiler to generate the necessary class files. I have tried the
>> following solution:
>>
>>
>> final IProgressMonitor monitor = new IProgressMonitor() {
>> boolean isDone = false;
>> @Override
>> public void done() {
>> if (!isDone) {
>> isDone = true;
>> // doing the post-compilation stuff here
>> }
>> }
>> };
>>
>> project.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );
>>
>>
>> My problem is that in some cases done() is called several times. Ok,
>> I've introduced that isDone flag, and the handler code is executed
>> only after the first call (hope it's right this way).
>>
>> However, it seems the class files I require are not exists when done()
>> is called. What am I doing wrong? Any suggestions how to deal with this?
>>
>> Checking how many times done() is called and executing the code then
>> would obviously a nightmare, and ain't sure if it would even work.
>>
>> (I want to compile the java files in the project and put them into a
>> jar. However, some of the class files are always missing or they are
>> partially compiled in the generated jar).
>>
>> Thanks in advance,
>> ---
>> Richard O. Legendi, programmer
>> AITIA International Inc.
>> E-mail: rlegendi@aitia.ai
Previous Topic:cvs timeout problem
Next Topic:Goto line action not shown in navigate menu
Goto Forum:
  


Current Time: Wed Mar 12 00:32:02 EDT 2025

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

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

Back to the top