use of org.eclipse.equinox.p2.publisher.eclipse.Feature in project tycho by eclipse.
the class P2DependencyGeneratorImplTest method rcpFeature.
@Test
public void rcpFeature() throws Exception {
generateDependencies("rcp-feature", PackagingType.TYPE_ECLIPSE_APPLICATION);
assertEquals(1, units.size());
IInstallableUnit unit = units.iterator().next();
assertEquals("org.eclipse.tycho.p2.impl.test.rcp-feature", unit.getId());
assertEquals("1.0.0.qualifier", unit.getVersion().toString());
assertEquals(2, unit.getRequirements().size());
assertEquals(0, artifacts.size());
}
use of org.eclipse.equinox.p2.publisher.eclipse.Feature in project tycho by eclipse.
the class ProductDependenciesAction method getRequiredCapabilities.
@Override
protected Set<IRequirement> getRequiredCapabilities() {
Set<IRequirement> required = new LinkedHashSet<>();
if (product.useFeatures()) {
for (IVersionedId feature : product.getFeatures()) {
// $NON-NLS-1$
String id = feature.getId() + FEATURE_GROUP_IU_SUFFIX;
Version version = feature.getVersion();
addRequiredCapability(required, id, version, null, false);
}
} else {
for (FeatureEntry plugin : ((ProductFile) product).getProductEntries()) {
addRequiredCapability(required, plugin.getId(), Version.parseVersion(plugin.getVersion()), null, true);
}
}
if (product.includeLaunchers()) {
addRequiredCapability(required, "org.eclipse.equinox.executable.feature.group", null, null, false);
}
return required;
}
use of org.eclipse.equinox.p2.publisher.eclipse.Feature in project epp.mpc by eclipse.
the class MarketplaceWizard method computeNewInstallCatalogItems.
private Set<CatalogItem> computeNewInstallCatalogItems() {
Set<CatalogItem> items = new HashSet<CatalogItem>();
Map<CatalogItem, Collection<String>> iusByCatalogItem = new HashMap<CatalogItem, Collection<String>>();
for (CatalogItemEntry entry : getSelectionModel().getCatalogItemEntries()) {
List<FeatureEntry> features = entry.getChildren();
Collection<String> featureIds = new ArrayList<String>(features.size());
for (FeatureEntry feature : features) {
if (feature.computeChangeOperation() == Operation.INSTALL) {
featureIds.add(feature.getFeatureDescriptor().getId());
}
}
if (!featureIds.isEmpty()) {
iusByCatalogItem.put(entry.getItem(), featureIds);
}
}
for (IInstallableUnit unit : operationIUs) {
for (Entry<CatalogItem, Collection<String>> entry : iusByCatalogItem.entrySet()) {
if (entry.getValue().contains(unit.getId())) {
items.add(entry.getKey());
}
}
}
return items;
}
use of org.eclipse.equinox.p2.publisher.eclipse.Feature in project webtools.servertools by eclipse.
the class ExtensionUtility method addExtension.
private static void addExtension(List<IServerExtension> list, List<Extension> existing, IServerExtension newFeature, ExtensionListener listener) {
if (alreadyExists(existing, newFeature))
return;
synchronized (list) {
Version newV = newFeature.getVersion();
IServerExtension remove = null;
Iterator<IServerExtension> iterator = list.iterator();
while (iterator.hasNext()) {
IServerExtension feature = iterator.next();
if (feature.getId().equals(newFeature.getId())) {
if (newV == null)
// don't add if already exists
return;
if (feature.getVersion().compareTo(newV) < 0) {
remove = feature;
} else
// new feature is older
return;
}
}
if (remove != null) {
list.remove(remove);
if (listener != null)
listener.extensionRemoved((Extension) remove);
}
list.add(newFeature);
}
if (listener != null) {
listener.extensionFound((Extension) newFeature);
}
if (listener == null && newFeature instanceof ExtensionProxy)
serverExtension.add(createServerProxy((ExtensionProxy) newFeature));
}
use of org.eclipse.equinox.p2.publisher.eclipse.Feature in project knime-core by knime.
the class OSGIHelperTest method testGetFeature.
/**
* Checks whether the feature for a bundle is resolved correctly.
*/
@Test
public void testGetFeature() {
assumeThat("Gettings feature when running from SDK not possible", EclipseUtil.isRunFromSDK(), is(false));
Bundle bundle = OSGIHelper.getBundle(NodeModel.class);
Optional<IInstallableUnit> iUnit = OSGIHelper.getFeature(bundle);
assertThat("Feature for NodeModel not found", iUnit.isPresent(), is(true));
assertThat("Unexpected feature for NodeModel returned", iUnit.get().getId(), is("org.knime.features.base.feature.group"));
bundle = OSGIHelper.getBundle("org.knime.ext.jfreechart");
iUnit = OSGIHelper.getFeature(bundle);
assertThat("Feature for JFreeChart not found", iUnit.isPresent(), is(true));
assertThat("Unexpected feature for JFreeChart returned", iUnit.get().getId(), is("org.knime.features.ext.jfreechart.feature.group"));
}
Aggregations