It's all about the answers!

Ask a question

Creating build definitions programatically


Dnyanesh Markad (291425) | asked Feb 21 '13, 5:52 a.m.
edited Feb 22 '13, 1:28 p.m. by Spencer Murata (2.3k115970)
Hi,

Can we create build definitions programatically in RTC? If yes can you provide which APIs are helpful for programmatic creation of build definitions.
Any help Appreciated

Many Thanks,
Dnyanesh

Accepted answer


permanent link
Eric Jodet (6.3k5104120) | answered Feb 22 '13, 10:26 a.m.
JAZZ DEVELOPER
Hello,
similar thread here - https://jazz.net/forum/questions/77786/how-to-create-build-definition-via-sdk-api

Thanks.
Eric.
Dnyanesh Markad selected this answer as the correct answer

Comments
Dnyanesh Markad commented Feb 26 '13, 1:07 a.m.

Hi Eric,

Thanks for the quick reply. I want to create the server side plugin for creation of build definitions programatically. Can you help me by providing some code snippet for creating build definitions programatically.

Many Thanks,
Dnyanesh


Dnyanesh Markad commented Feb 26 '13, 4:27 a.m. | edited Feb 26 '13, 4:28 a.m.

Below is my code. Idea is creating the build definition from the existing build definition. But I am not able to find the save () method to save the build defintion created programatically.

buildService = getService(ITeamBuildService.class);
fprocessServerService = getService(IProcessServerService.class);
String projectAreaName = "PABuild";
String buildId = "PABuild build_JBEAnt";
IProcessArea processArea = fprocessServerService.findProcessArea(projectAreaName, null);
IProjectAreaHandle projectArea=processArea.getProjectArea();
IBuildDefinition buildDef = buildService.getBuildDefinition(buildId);
IBuildDefinition buildDefCopy =  buildDef.copyDefinition();
String newBuildID = "newBuildDefinition";
buildDefCopy.setId(newBuildID);

Your answer


Register or to post your answer.