Is it possible to set the workspace Name for a personal build using RTC SDK?
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
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);
}