Is possible to use LogPublisher classes in custom ant task?
Hi,
I've developed many ant tasks that connect to RTC through plain API and do things. What I'd like to do is to add some lines on Activities tab on the build result. I know that the build toolkit provides a specific task for this (logPublisher) but I'd like to push many activities from my specific task (otherwise I have to cut my task in more pieces and use publisher task between them with low performances). Is it possible? Which classes could I use? Thanks, Michele. |
Accepted answer
Hi Michele,
If the existing Ant tasks don't cut it for you, the underlying Java client APIs are:
com.ibm.team.build.client.ITeamBuildClient.startBuildActivity(IBuildResultHandle, String, String, boolean, IProgressMonitor)
com.ibm.team.build.client.ITeamBuildClient.completeBuildActivity(IBuildResultHandle, String, IProgressMonitor)
where the ITeamBuildClient is obtained using:
com.ibm.team.build.client.ClientFactory.getTeamBuildClient(ITeamRepository)
Michele Pegoraro selected this answer as the correct answer
Comments
Michele Pegoraro
commented Aug 01 '13, 3:14 a.m.
Thanks, this is exactly what I was looking for.
Michele
|
One other answer
To add activites you would need to use the startBuildActivity and completeActivity. They are not really supposed to be used for bulk updates. You can open as many activities as you would like, but only one per task, and then you can complete them. But that somewhat loses the point of the activity. They are supposed to mark build activity, so they are supposed to be split up among the build activities you are trying to track.
~Spencer
|
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.
Comments
You are mixing some build terminology. Are you talking about contributing logs or contributing activities? The activities are what appear in the activities tab and are just logical components of the build. The logpublisher contributes logs to the build so you can read the logs as part of the build result. Generally though you can only contribute one build log per logpublisher instance.
Yeah, I was wrong. I was searching for adding activity lines to build results.
Just curious: what does your custom task do?
A lot of stuff. I've many custom tasks to do specific things for customers: versioning of binaries produced by builds, delivery, creation of zip packages of modified files, creation or modify of existing work items. In many cases it is easier to create custom task than to use rest api from ant builds and deploy scripts.