Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:48 Go to next message
Richard Oliver Legendi is currently offline Richard Oliver LegendiFriend
Messages: 34
Registered: July 2009
Member
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 09:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to build and wait IProject.build()? [message #336542 is a reply to message #336534] Mon, 22 June 2009 06:44 Go to previous message
Richard Oliver Legendi is currently offline Richard Oliver LegendiFriend
Messages: 34
Registered: July 2009
Member
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: Sat Apr 20 00:31:52 GMT 2024

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

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

Back to the top