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.
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)
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
Comments
Spencer Murata
FORUM MODERATOR / JAZZ DEVELOPER Jul 17 '13, 9:16 a.m.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.
Michele Pegoraro
Jul 17 '13, 9:51 a.m.Yeah, I was wrong. I was searching for adding activity lines to build results.
Nick Edgar
JAZZ DEVELOPER Jul 29 '13, 2:51 p.m.Just curious: what does your custom task do?
Michele Pegoraro
Aug 01 '13, 3:19 a.m.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.