Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC Build using build forge through the plain java api (SDK)

My question is related to doing a build in RTC using Build forge through the plain java api (SDK) as shown in the link below

https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples

Is there a way to pass in properties using the API that have been defined in build forge / the build definition ( they would usually be passed in through the build request in the RTC client ).

Please let me know if you need any more info



0 votes



2 answers

Permanent link
SOULTION 

ITeamBuildClient buildClient = (ITeamBuildClient) teamRepository.getClientLibrary(ITeamBuildClient.class);
IBuildDefinition buildDefinition = buildClient.getBuildDefinition(buildDefinitionId, monitor);

IBuildDefinition buildDefinitionWorking = (IBuildDefinition) buildDefinition.getWorkingCopy();
ITeamBuildRequestClient requestClient = (ITeamBuildRequestClient) teamRepository.getClientLibrary(ITeamBuildRequestClient.class);

buildDefinitionWorking.setProperty("release-env", "aaa");
requestClient.save(buildDefinitionWorking, monitor);

IBuildRequest buildRequest = requestClient.requestBuild(buildDefinitionWorking, true, monitor);
return buildRequest; 

0 votes


Permanent link
 Use the IBuildRequest to get to the BuildDefinitionInstance or directly get the properties via getBuildDefinitionProperties() and then you can do a get on the property and set the value to whatever you want.

~Spencer

0 votes

Comments

Hi Spencer


Thanks for the reply. Can you please include an example? the documention on how to use this API / the java docs are very basic.

here is what i have so far to get the build request and do the build

 ITeamBuildClient buildClient = (ITeamBuildClient) teamRepository.getClientLibrary(ITeamBuildClient.class);
IBuildDefinition buildDefinition = buildClient.getBuildDefinition(buildDefinitionId, monitor);
ITeamBuildRequestClient requestClient = (ITeamBuildRequestClient) teamRepository.getClientLibrary(ITeamBuildRequestClient.class);
IBuildRequest buildRequest = requestClient.requestBuild(buildDefinition, true, monitor);

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,930

Question asked: Oct 11 '13, 5:47 a.m.

Question was seen: 7,046 times

Last updated: Oct 21 '13, 9:55 a.m.

Confirmation Cancel Confirm