Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Status after a build

There are several aspects of this issue.

1) Indeed you can check error markers for project. The only thing to be taken in account is that you should synchronize marker generation and checking. I guess that these could be different threads and you can check before markers are generated. Look at ErrorParserManager in order to understand that. Anyway, we use this method as the last option. 2) More reasonable for me is to modify interface of the build invocation. You can use one of project.build() parameters (Map) to path MultyStatus object, then set it in your builder (result of build can be validated using reportProblems() or hasErrors() from ErrorParsrManager) and then analyze this status on the calling side after project.build returns back. Neither MBS builder, nor Regular Make builder do it, I guess. 3) I think in implementation of reportProblems there is an error: It reports error status only if severity code is SEVERITY_ERROR_BUILD. It is not always the case , sometimes compiler can not generate resource-connected errors (for example, if wrong command line parameter was used), and make errors has a SEVERYTY_ERROR_RESOURCE severity and then function returns no errors instead of there are make errors. I did not investigate the case when internal MBS builder is used.

I'd be glad if this information will be helpful.

Alex

Wieant Nielander wrote:
I want to check the status after a build to see if everything went OK and if
a binary file was created. I call build with either;

ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD,
monitor);
or
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);.

Does someone got any ideas or can direct me to any guides?

(btw, build(...) is returning void so I can't just check a report from that
function.)

Perhaps you can check for C/C++ error markers for the given project,
and if at least one exists presume the binary to be invalid (and to be
safe check for the binary itselve to exist)?
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




Back to the top