How to access RTC build engine status programmatically.
We need to be able to pass status back from an ongoing build process that is running in a remote RTC build engine. We need to find the object that the RTC Build Engine uses to pass back the current build status message to the server/client, i.e. what the user sees in the Progress column of the Builds view upon refresh. It's most likely an org.eclipse.core.runtime.IProgressMonitor object. Then we need access to this object so we can update build progress messages.
|
2 answers
Hi Bruce,
There are Ant tasks available in the build toolkit that allow you to contribute to a build result's progress. You can read about them in the current release's docs under development here, https://jazz.net/help-dev/clm/topic/com.ibm.team.build.doc/topics/r_enableprogressmonitor.html. Or you can find the equivalent doc in your release's docs. Also, notice the other Ant tasks available in that context. Scott Comments
Bruce Eifler
commented Nov 07 '13, 11:23 a.m.
The available methods are limited to startBuildActivity and
You can create child activities to break down the progress of a parent activity, but unlike IProgressMonitor, you cannot divide an activity into units and update the number of completed units.
Bruce Eifler
commented Nov 07 '13, 1:06 p.m.
To be more clear. The update methods available are both ANT tasks. We are using ANT to execute our external Java code to perform a build. We would like to be able to send status updates from our Java build processes that would be sent to the user viewable panel on the RTC client.
|
Hi Bruce,
I couldn't fit this all in a comment to the answer above, so I've created another answer. Here's an example I whipped up based on the example at startBuildActivity and Integrating with Jazz SCM and Builds from Hudson and Jenkins . You can see what the progress looks like in the Builds view below. It looks like, where build.xml contains, <project name="sample" default="compile"> <property name="userId" value="ADMIN" /> <property name="password" value="ADMIN" /> <taskdef name="startBuildActivity" classname="com.ibm.team.build.ant.task.StartBuildActivityTask" /> <taskdef name="completeBuildActivity" classname="com.ibm.team.build.ant.task.CompleteBuildActivityTask" /> <taskdef resource="net/sf/antcontrib/antlib.xml" /> <target name="compile"> <echo message="Compiling parent"/> <startBuildActivity label="Compiling parent" activityIdProperty="parentId" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" /> <sleep milliseconds="1000"/> <for list="1,2,3,4,5,6,7,8,9,10" param="num" delimiter=","> <sequential> <echo message="Compiling child @{num}"/> <startBuildActivity label="Compiling child @{num}" parentActivityId="${parentId}" autocomplete="true" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" /> <sleep milliseconds="1000"/> </sequential> </for> <completeBuildActivity activityId="${parentId}" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" /> </target> </project> Comments
Bruce Eifler
commented Nov 18 '13, 5:15 p.m.
We are calling a custom java build process from ANT we need to be able to send back status from within our java code to provide a more detailed status to our users.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.