Search in sources :

Example 1 with SiteFeature

use of org.eclipse.equinox.internal.p2.updatesite.SiteFeature in project tycho by eclipse.

the class AbstractSiteDependenciesAction method getRequiredCapabilities.

@Override
protected Set<IRequirement> getRequiredCapabilities() {
    Set<IRequirement> required = new LinkedHashSet<>();
    for (SiteFeature feature : getSiteModel().getFeatures()) {
        // $NON-NLS-1$
        String id = feature.getFeatureIdentifier() + FEATURE_GROUP_IU_SUFFIX;
        VersionRange range = getVersionRange(createVersion(feature.getFeatureVersion()));
        String filter = new TargetEnvironment(feature.getOS(), feature.getWS(), feature.getOSArch()).toFilterExpression();
        // boolean optional = feature.isOptional();
        required.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, id, range, InstallableUnit.parseFilter(filter), false, false));
    }
    for (SiteBundle bundle : getSiteModel().getBundles()) {
        String id = bundle.getBundleIdentifier();
        VersionRange range = getVersionRange(createVersion(bundle.getBundleVersion()));
        String filter = new TargetEnvironment(bundle.getOS(), bundle.getWS(), bundle.getOSArch()).toFilterExpression();
        // boolean optional = feature.isOptional();
        required.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, id, range, InstallableUnit.parseFilter(filter), false, false));
    }
    for (SiteIU iu : getSiteModel().getIUs()) {
        IRequirement requirement = getRequirement(iu);
        if (requirement != null)
            required.add(requirement);
    }
    return required;
}
Also used : IRequirement(org.eclipse.equinox.p2.metadata.IRequirement) LinkedHashSet(java.util.LinkedHashSet) SiteIU(org.eclipse.equinox.internal.p2.updatesite.SiteIU) SiteFeature(org.eclipse.equinox.internal.p2.updatesite.SiteFeature) VersionRange(org.eclipse.equinox.p2.metadata.VersionRange) SiteBundle(org.eclipse.equinox.internal.p2.updatesite.SiteBundle) TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment)

Aggregations

LinkedHashSet (java.util.LinkedHashSet)1 SiteBundle (org.eclipse.equinox.internal.p2.updatesite.SiteBundle)1 SiteFeature (org.eclipse.equinox.internal.p2.updatesite.SiteFeature)1 SiteIU (org.eclipse.equinox.internal.p2.updatesite.SiteIU)1 IRequirement (org.eclipse.equinox.p2.metadata.IRequirement)1 VersionRange (org.eclipse.equinox.p2.metadata.VersionRange)1 TargetEnvironment (org.eclipse.tycho.core.shared.TargetEnvironment)1