Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 300698

Summary: [metadata] support mutually exclusive connectors
Product: [Eclipse Project] Equinox Reporter: Igor Burilo <igor.burilo>
Component: p2Assignee: Pascal Rapicault <pascal>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: pascal, thomas
Version: unspecified   
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Igor Burilo CLA 2010-01-25 11:16:00 EST
Currently in Connectors Discovery we can select connectors which we want to install by using check boxes, but there are cases when you need to install only one of the connectors, i.e. connectors are mutually exclusive. For instance, in Subversive we have JavaHL SVN Connector and there are several versions of it: 1.4, 1.5, 1.6 but there's a restriction of JVM that you can install only one of them at the same time; of course, I understand that it's not a common use case, but there may be other use cases where this feature may become helpful as Discovery feature is planed to move to p2.


-- Configuration Details --
Product: Eclipse 1.2.0.20090615-0858 (org.eclipse.epp.package.rcp.product)
Installed Features:
 org.eclipse.mylyn_feature 3.3.2.I20100109-0400-e3x
Comment 1 Steffen Pingel CLA 2010-01-25 11:48:51 EST
Moving this to P2 where we'll be tracking changes to discovery now.
Comment 2 Pascal Rapicault CLA 2010-01-25 20:21:05 EST
I knew this was coming :) In this release, through the revamping of IRequiredCapability in IRequirement, it should not be possible to write an expression to capture this. Note though that this new metadata would only work for 3.6 and up.
Assigning to Thomas for addition of a test case in the planner bucket.

Igor, note that at this point we still have to work on our persistence story and this may not be ready for M6.
Comment 3 Pascal Rapicault CLA 2010-03-11 12:35:02 EST
The persistence support is now in, so you should be able to make use of this. However note that this will only work on 3.6 and up.

Here is an example out of a test:
String orExpression = "providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'org.eclipse.mylyn34' || pc.name == 'org.eclipse.mylyn35'))";
		IExpression expr = ExpressionUtil.parse(orExpression);
		IMatchExpression matchExpression = ExpressionUtil.getFactory().matchExpression(expr);
		IRequirement orRequirement = MetadataFactory.createRequirement(matchExpression, null, 0, 1, true);

I'm still leaving this open to do further testing.