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
2 answers
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
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);
SOULTION
ITeamBuildClient buildClient = (ITeamBuildClient) teamRepository.getClientLibrary(ITeamBuildClient.class);
return buildRequest;
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);