How do I set the state of a build result created with "BuildItemFactory.createBuildResult()"?
![]()
Todd Strangio (52●6●10)
| asked Jun 17 '13, 9:33 a.m.
retagged Jun 17 '13, 9:46 a.m. by Abraham Sweiss (2.4k●12●31)
I've written some Java to create a build result within a specific build definition. Works OK, however, the newly created build result is created in the 'NOT_STARTED' state, and there doesn't seem to be a 'setBuildState()' method. How is this accomplished so the build result can be created and set to 'COMPLETED' state?
|
Accepted answer
![]()
You don't set the state explicitly, you move it through the states through the build request service. So when you call the startBuildWithoutProcess() or the like, it will move the build to RUNNING. Then when it is complete you call makeBuildCompleteWithoutProcess or the like to move it to COMPLETE. So there is no setState, just lifecycle commands from the request service.
~Spencer
Todd Strangio selected this answer as the correct answer
Comments Thanks Spencer, I'm looking into this possibility now. Any chance you can provide an example? I'm not seeing how to move through the process for a build result created using BuildItemFactory. Thanks in advance.
Take a look at
To mark a build result as 'Complete', I first had to claim it. Thanks Heather!
buildRequestClient.claimRequest(IBuildRequestHandle buildRequestHandle, IBuildEngineHandle buildEngineHandle, java.lang.String[] properties, org.eclipse.core.runtime.IProgressMonitor progressMonitor); |