It's all about the answers!

Ask a question

Is it possible to set the workspace Name for a personal build using RTC SDK?


Liora Milbaum (513276108) | asked Oct 12 '12, 7:17 p.m.
 I am in the process of developing a deliver (server) adviser which is kicking off a personal build in the same workspace as the deliver operation was performed.

Here is a snippet of the current function. The current code kicks off the build in the workspace listed in the build definition (which is no good for me).

protected void build() throws TeamRepositoryException {

ITeamBuildService buildService = getService(ITeamBuildService.class);
IBuildDefinition buildDef = buildService.getBuildDefinition("CopyToPublic");

ITeamBuildRequestService brService = getService(ITeamBuildRequestService.class);
/* 
* Kickoff a personal build
*/
IItemsResponse response = brService.requestBuild(buildDef, null,
null, true, true);

}

How do I specify in the request build process to perform the build in a different workspace?

Appreaciate your assistance,
Liora

One answer



permanent link
Liora Milbaum (513276108) | answered Oct 13 '12, 11:15 a.m.
 I figured it out. Here is the code snippet:

protected void build(IWorkspace workspace) throws TeamRepositoryException {

ITeamBuildService buildService = getService(ITeamBuildService.class);
IBuildDefinition buildDef = (IBuildDefinition) buildService.getBuildDefinition("CopyToPublic");
IBuildProperty[] buildProperties = new IBuildProperty[2];
buildProperties[0] = BuildItemFactory.createBuildProperty(IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID,
workspace.getItemId().getUuidValue());
buildProperties[1] = BuildItemFactory.createBuildProperty("loadDir", "c:\\tmp\\loadDir");

ITeamBuildRequestService brService = getService(ITeamBuildRequestService.class);
IItemsResponse response = brService.requestBuild(buildDef, buildProperties, null, true, true);
}

Your answer


Register or to post your answer.