[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [pde-dev] RE: how my builder knows compile errors existence
|
To get you started...
1. Use a project nature to associate your builder with a project.
2. Get the markers for the project and look for compilation errors to determine if the project was successfully compiled.
Mijung Kim wrote on 9/9/08 2:19 am
>
>Hi,
>
>I am make an Eclipse builder
>plugin that does some action
>when a project is compiled
>succesfully.
>
>I have a couple of questions
>about an Eclipse builder as
>following:
>
>1.
>In order to associate my
>builder with a project, I made
>an additional java files that
>toggles the nature by adding
>a command in the menu
>shown when you right click
>the project name. This is how
>I trigger and disable my
>builder.
>However, this is not the way
>that I want. I want to trigger
>my builder just by running
>my plugin.
>
>Is there any way that I can
>associate my builder with a
>project in such way? For
>example, when you run my
>builder, I want you to be able
>to build your project with my
>builder, without doing any
>special action.
>
>2.
>My builder should do some
>action only when a project is
>compiled successfully.
>Therefore, my builder has to
>be aware whether the
>project has compile errors
>after build.
>
>Below is how I wrote the
>builder.
> try {
>monitor.beginTask("Increme
>ntal build starting", 1);
>getProject().build(Increment
>alProjectBuilder.INCREMENTA
>L_BUILD, monitor);
>monitor.done(); } catch
>(CoreException e)
>{//compile error occured}
> I thought that build(...)
>method throws an
>CoreException when build
>fails. (meaning when there is
>a compile error) However,
>even if there is an obvious
>compile error in the project,
>build(...) method does not
>throw any CoreException in
>my builder.
>Could you tell me how I can
>catch the existence of
>compile errors in my builder?
>
>Thank you very much.
>
>MJ
>_____________________________
>_____________________________
>_______
>News, entertainment and
>everything you care about
>at Live.com. Get it now!
>http://www.live.com/getstar
>ted.aspx