It's all about the answers!

Ask a question

Is possible to use LogPublisher classes in custom ant task?


Michele Pegoraro (1.8k12114101) | asked Sep 17 '12, 4:35 a.m.
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.

Comments
Spencer Murata commented Jul 17 '13, 9:16 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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 commented Jul 17 '13, 9:51 a.m.

Yeah, I was wrong. I was searching for adding activity lines to build results.


Nick Edgar commented Jul 29 '13, 2:51 p.m.
JAZZ DEVELOPER

Just curious: what does your custom task do? 


Michele Pegoraro commented 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. 

Accepted answer


permanent link
Nick Edgar (6.5k711) | answered Jul 29 '13, 2:48 p.m.
JAZZ DEVELOPER
edited Jul 29 '13, 2:49 p.m.
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



permanent link
Spencer Murata (2.3k115970) | answered Jul 25 '13, 4:30 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
 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


Register or to post your answer.