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


> 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
}





Back to the top