It's all about the answers!

Ask a question

Ant property or Java API call to get current build activity & build engine.


M Holder (53610) | asked Apr 23 '14, 1:44 p.m.
Is there any (public) way to tell what the current build activity is when running an RTC build?

I can look at the build in the RTC eclipse client and it will say "fetching files" or "Running Unit tests" (or whatever we specified using the last startBuildActivity task), but I'd like to be able to find this out from within the build, either as part of a Java build task or as an Ant property (that I can then send to my build task).

I'd also like to be able to find the current build engine's name (which might not be the host name).

Are either of these possible? (Using RTC 4.0.5)

thanks

One answer



permanent link
sam detweiler (12.5k6185201) | answered Apr 23 '14, 2:14 p.m.
If on the build definition ant tab you specify the properties file, this data will be provided

and in the build.xml load the properties file
  <loadproperties srcFile="./all.properties"/>

for example, a little hello world java compile on my test system

team.scm.includeComponents=false
repositoryAddress=https\://localhost\:9143/ccm/
team.scm.fetchDestination=m\:\\builds\\test workpace
buildDefinitionId=test
project=hello world
buildEngineHostName=sams
team.scm.loadComponents=
com.ibm.team.build.internal.template.id=com.ibm.team.build.ant
team.scm.buildOnlyIfChanges=false
team.scm.createFoldersForComponents=false
team.scm.workspaceUUID=_0NDxEML_EeOZQPpfGt216g
buildEngineId=testing
buildLabel=20140418-0751
requestUUID=_Ge93gMb4EeOjy4RglL53dA
buildRequesterUserId=sam
buildResultUUID=_Ge93gcb4EeOjy4RglL53dA
team.scm.acceptBeforeFetch=false
team.scm.deleteDestinationBeforeFetch=true
com.ibm.team.build.internal.engine.template.id=com.ibm.team.build.engine.jbe
team.scm.componentLoadRules=
com.ibm.team.build.internal.engine.monitoring.threshold=3

Comments
M Holder commented May 08 '14, 3:16 p.m.

Thanks that's useful as it shows me all the available properties at startup so I can just use buildEngineId to get the build engine's name. (There is another far less pleasant way to get this using the java api but this is nicer)

However it won't get me the current build activity - I think I may be able to get this from an IBuildActivity if I can persuade the API to furnish me with one.


sam detweiler commented May 08 '14, 3:22 p.m. | edited May 08 '14, 3:23 p.m.

see
https://jazz.net/wiki/bin/view/Main/BuildActivities

Capturing an Activity ID

found with
google search string

'ant tasks site:jazz.net'

Your answer


Register or to post your answer.