How to get/set the workspace in Build Definition via SDK API
Hi,
Is there any one know how to get/set the workspace if I get the builddefiniton.
Thanks!
This is the code to rename a definition id, how to reset a workspace?
Thanks!
Is there any one know how to get/set the workspace if I get the builddefiniton.
Thanks!
ITeamBuildClient buildClient = (ITeamBuildClient) repo.getClientLibrary(ITeamBuildClient.class);
IBuildDefinition buildDef = buildClient.getBuildDefinition(buildDefininionName, monitor);
//modify the name
buildDef = (IBuildDefinition)buildDef.getWorkingCopy();
buildDef.setId("aa");
This is the code to rename a definition id, how to reset a workspace?
Thanks!
Accepted answer
Assuming the build definition was created with the Jazz SCM pre-build option, you can set the workspace property using:
com.ibm.team.build.common.model.IBuildDefinition.setProperty(String, String)
giving:
com.ibm.team.build.internal.common.builddefinition.IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID
as the property name, and the workspace item id as the value:
aWorkpace.getItemId().getUuidValue()