It's all about the answers!

Ask a question

Problems with startBuildActivity when calling Ant externally


Bill Higgins (4562523) | asked Aug 13 '11, 4:49 p.m.
JAZZ DEVELOPER
I have a build script implemented in Ruby running under the Jazz Build Engine that adds progress monitoring to a build result by calling Ant tasks via an external Java process.

E.g. in my Ruby script I call Ant like so:

`#{JAVA} -cp #{SOURCE_ROOT}/org.apache.ant/lib/ant-launcher.jar org.apache.tools.ant.launch.Launcher -f #{SOURCE_ROOT}/com.ibm.devops.site/build/publish_results.xml -lib #{BUILD_TOOLKIT} -DbuildResultUUID=#{@build_result_uuid} -DrepositoryAddress=#{@repository_url} -DactivityIdProperty=#{activity_id} -DautoComplete=#{autocomplete} -Dlabel='#{progress_message}' #{task}`

This works fine when I don't try to use hierarchal progress (i.e. when I don't specify a parentActivityId). Whenever I try to call this and specify a parentActivityId, it always fails with the following message:

BUILD FAILED
com.ibm.team.build.common.TeamBuildException: The build activity with id "run_cookbook" does not exist in the build result.

... even though my logging and the build result clearly shows that the activity with activityIdProperty 'run_cookbook' did get created.

After a couple of hours of trying various things, I'm wondering if the problem is that I'm publishing each build activity in a separate Java process and the Ant task implementation for startBuildActivity stores the activity hierarchy in the Java program memory (meaning the hierarchy gets lost between each of my invocations of java).

Can someone with more knowledge of the build toolkit implementation please comment? Any recommendations on how to use hierarchal activities if you're using a non-Ant build? I'm following the guidance from this wiki page: https://jazz.net/wiki/bin/view/Main/CppBuild

3 answers



permanent link
Bill Higgins (4562523) | answered Aug 14 '11, 3:35 p.m.
JAZZ DEVELOPER
I figured out what I was doing wrong.

I thought that I was supposed to specify an activity ID when I ran the startBuildActivity task. Now I realize that the activity IDs are always handed back to you essentially after you run startBuildActivity. That's why you specify 'activityIdProperty' instead of 'activityId' - the value of the activityId gets written back to the property specified by activityIdProperty.

I would suggest updating the documentation to provide an example of using a parent activity. The documentation is quite unhelpful at the moment w/r/t using parent activities.

permanent link
Bill Higgins (4562523) | answered Aug 14 '11, 3:42 p.m.
JAZZ DEVELOPER
Created Task 174115: Improve documentation around startBuildActivity Ant task to improve documentation around hierarchal progress feedback.

permanent link
Brent Ulbricht (2.5k11) | answered Aug 14 '11, 3:47 p.m.
JAZZ DEVELOPER
Created Task 174115: Improve documentation around startBuildActivity Ant task to improve documentation around hierarchal progress feedback.


Hi,

We'll have to take a look at the documentation. There is a Wiki page that gives more detail about activities.

Brent Ulbricht
RTC Build Lead

Your answer


Register or to post 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.