how to assigning a BuildEngine to a BuildDefinition using the plain java API
Hello,
I have created a IBuildDefinition and a IBuildEngine with the plain java api.
The GUI allows me to add "supported build definition" to a build engine or to add a "supporting build engine" to a build definition. How can I do the same in the java api?
A code spinet would be great.
thanx in advance, Steffen
I have created a IBuildDefinition and a IBuildEngine with the plain java api.
The GUI allows me to add "supported build definition" to a build engine or to add a "supporting build engine" to a build definition. How can I do the same in the java api?
A code spinet would be great.
thanx in advance, Steffen
3 answers
Exception in thread "main" com.ibm.team.repository.common.internal.Immutable...
unless you explicitly request it, all objects are really read-only. (Immutable)
to get a modifiable version, you must get is workingcopy..
buildClient.save(buildEngine,null);
unless you explicitly request it, all objects are really read-only. (Immutable)
to get a modifiable version, you must get is workingcopy..
then you have to save the changed object.IBuildEngine buildEngine = (IBuildEngine)buildEngine.getWorkingCopy();
buildClient.save(buildEngine,null);
this is one of the bad side effects apis..
IBuildEngine.getSupportedBuildDefinitions().add(IBuildDefinitionHandle);
the build engine will update the build definition list with the supplied id.
IBuildEngine.getSupportedBuildDefinitions().add(IBuildDefinitionHandle);
the build engine will update the build definition list with the supplied id.
@Sam, I also try to solve this out.
ITeamBuildClient buildClient = (ITeamBuildClient) jazzapi.repo.getClientLibrary(ITeamBuildClient.class);
IBuildDefinition buildDefinition = buildClient.getBuildDefinition("MyBuildDefinition", null);
IBuildDefinitionHandle buildDefinitionHandle = (IBuildDefinitionHandle) buildDefinition.getItemHandle();
IBuildEngine buildEngine = buildClient.getBuildEngine("MyEngine", null);
buildEngine.getSupportedBuildDefinitions().add(buildDefinitionHandle);
Exception in thread "main" com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2070)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:310)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
at dk.test.Snippet.main(Snippet.java:53)
What am I missing?
Thanks, Steen
Comments
Bradley Mosher
Oct 09 '14, 3:54 p.m.Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 29 '14, 2:43 p.m.sam detweiler
Nov 29 '14, 2:44 p.m.Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 29 '14, 2:46 p.m.sam detweiler
Nov 29 '14, 2:47 p.m.Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 29 '14, 2:47 p.m.sam detweiler
Nov 29 '14, 6:16 p.m.