Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Determining IMakeTarget execution success


Thanks Alain.

It's good that I can get to the information I want (if errors or warnings occured).  I think I'll enter a bug against this to have these methods return an IStatus.  It would be much cleaner if the IMakeTarget.build() returned the IStatus in an OK, Warning, or Error state.  Of course, there are probably many little pitfalls of which I'm unaware.

Again, thanks for the example code.  It will keep us going while the bug is open.

Chad


Alain Magloire <alain@xxxxxxx>
Sent by: cdt-dev-bounces@xxxxxxxxxxx

08/19/2005 05:20 PM

Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

To
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>
cc
Subject
RE: [cdt-dev] Determining IMakeTarget execution success







> Behalf Of cebarne2@xxxxxxxxxxxxxxxxxxx
> Sent: Wednesday, August 17, 2005 9:23 AM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] Determining IMakeTarget execution success
>
>
> In an effort to better support build automation and scheduling I need to
> determine if a make target execution was successful or not.  How can I
> figure out (via API) if the make process ended in an error?  This is for
> standard make, not MBS.  I already programatically generate the makefiles,
> create the make targets, and queue them up in a nifty build manager
> utility... Now I want to make the different queued tasks dependent on
> their predecessors.  I can only do that if I can determine each make
> target's return status.
>

Hmm ... It is a good request.

The IProject.build() or the IMakeTarget.build() will throw a CoreException
and the we can retrieve the IStatus from the core.  But we only throw
exception when something horrible happen, not for compile errors.  

One possible way to do this is to get the CMarkers on the project/folder,
since the error parsers will mark any pattern that they identify as a build
error.

Something like:

IWorkspace workspace = currProject.getWorkspace();

IMarker[] markers=
currProject.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true,
IResource.DEPTH_INFINITE);
if (markers != null && markers.length > 0) {
                // Huston, we got a problem
} else {
                // steady as she goes Mr. Data
}



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top