How can I update the build status programatically
![]()
I am writing an ant task to update the build status (OK, WARNING, ERROR) based on certain properties that are set in the build. I only want to set the status.
My code set a BuildStatus object to OK, WARNING or ERROR. then sets the IBuildResultContribution to the status using setStatus(). At this point I'd like to add the the contribution but Ant fails when I do. It looks like I have to set the contribution type ID as well.
However I'm not publishing an artifact here, I just want to set the build status. Is there a way to do this programatically or am I going about it all wrong?
|
2 answers
![]()
I think I found my answer @ this question
I believe we used to support that in the BuildResultPublisherTask but tookit out because it had no tracibility to what actually caused the warningstate causing confusion. We switched to a model where the variouspublishers would support it so that the state could be tied to the actualcontribution causing the problem. If you look at any of the tasks thatextend from AbstractContentPublisherTask(ArtifactFilePublisherTask,FilePublisherTask, LogPublisherTask, etc) they all support a "status"attribute in the task where you can pass in one of "ERROR, WARNING, INFO,OK" so that a connection is made between the offending contribution and thestatus.So I'll publish the static analysis report xml with the build status set. |