Creating build definitions programatically
Accepted answer
similar thread here - https://jazz.net/forum/questions/77786/how-to-create-build-definition-via-sdk-api
Thanks.
Eric.
Comments
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
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);