Search in sources :

Example 1 with IVersionedId

use of org.eclipse.equinox.p2.metadata.IVersionedId in project tycho by eclipse.

the class ModuleMetadataRepositoryTest method unitsIn.

private static List<IVersionedId> unitsIn(IMetadataRepository repo) {
    IQueryResult<IInstallableUnit> units = repo.query(QueryUtil.ALL_UNITS, null);
    List<IVersionedId> unitIds = new ArrayList<>();
    for (Iterator<IInstallableUnit> unitIterator = units.iterator(); unitIterator.hasNext(); ) {
        IInstallableUnit unit = unitIterator.next();
        VersionedId unitId = new VersionedId(unit.getId(), unit.getVersion());
        unitIds.add(unitId);
    }
    return unitIds;
}
Also used : IVersionedId(org.eclipse.equinox.p2.metadata.IVersionedId) VersionedId(org.eclipse.equinox.p2.metadata.VersionedId) IVersionedId(org.eclipse.equinox.p2.metadata.IVersionedId) ArrayList(java.util.ArrayList) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit)

Example 2 with IVersionedId

use of org.eclipse.equinox.p2.metadata.IVersionedId 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;
}
Also used : IRequirement(org.eclipse.equinox.p2.metadata.IRequirement) LinkedHashSet(java.util.LinkedHashSet) FeatureEntry(org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry) ProductFile(org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile) IVersionedId(org.eclipse.equinox.p2.metadata.IVersionedId) Version(org.eclipse.equinox.p2.metadata.Version)

Example 3 with IVersionedId

use of org.eclipse.equinox.p2.metadata.IVersionedId in project tycho by eclipse.

the class ModuleMetadataRepositoryTest method createIUs.

private static List<IInstallableUnit> createIUs(IVersionedId... unitIds) {
    List<IInstallableUnit> result = new ArrayList<>();
    for (IVersionedId unitId : unitIds) {
        InstallableUnitDescription iuDescr = new InstallableUnitDescription();
        iuDescr.setId(unitId.getId());
        iuDescr.setVersion(unitId.getVersion());
        result.add(MetadataFactory.createInstallableUnit(iuDescr));
    }
    return result;
}
Also used : InstallableUnitDescription(org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription) IVersionedId(org.eclipse.equinox.p2.metadata.IVersionedId) ArrayList(java.util.ArrayList) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit)

Aggregations

IVersionedId (org.eclipse.equinox.p2.metadata.IVersionedId)3 ArrayList (java.util.ArrayList)2 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)2 LinkedHashSet (java.util.LinkedHashSet)1 ProductFile (org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile)1 IRequirement (org.eclipse.equinox.p2.metadata.IRequirement)1 InstallableUnitDescription (org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription)1 Version (org.eclipse.equinox.p2.metadata.Version)1 VersionedId (org.eclipse.equinox.p2.metadata.VersionedId)1 FeatureEntry (org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry)1