Search in sources :

Example 1 with VersionedId

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

the class MirrorApplicationServiceTest method seedFor.

private static Collection<DependencySeed> seedFor(VersionedId... units) {
    Collection<DependencySeed> result = new ArrayList<>();
    for (VersionedId unit : units) {
        InstallableUnitDescription seedDescriptor = new InstallableUnitDescription();
        seedDescriptor.setId("iu-requiring." + unit.getId());
        seedDescriptor.addRequirements(strictRequirementTo(unit));
        result.add(DependencySeedUtil.createSeed(null, MetadataFactory.createInstallableUnit(seedDescriptor)));
    }
    return result;
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) InstallableUnitDescription(org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription) VersionedId(org.eclipse.equinox.p2.metadata.VersionedId) ArrayList(java.util.ArrayList)

Example 2 with VersionedId

use of org.eclipse.equinox.p2.metadata.VersionedId 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 3 with VersionedId

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

the class StandardEEResolutionHints method addIUsFromEnvironment.

static void addIUsFromEnvironment(String executionEnvironment, Map<VersionedId, IInstallableUnit> units) {
    // generate real IUs that represent requested execution environment
    PublisherResult results = new PublisherResult();
    new JREAction(executionEnvironment).perform(new PublisherInfo(), results, null);
    results.query(QueryUtil.ALL_UNITS, null);
    Iterator<IInstallableUnit> iterator = results.query(QueryUtil.ALL_UNITS, null).iterator();
    while (iterator.hasNext()) {
        put(units, iterator.next());
    }
}
Also used : PublisherInfo(org.eclipse.equinox.p2.publisher.PublisherInfo) PublisherResult(org.eclipse.equinox.p2.publisher.PublisherResult) JREAction(org.eclipse.equinox.p2.publisher.actions.JREAction) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit)

Example 4 with VersionedId

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

the class MirrorApplicationServiceTest method strictRequirementTo.

private static Set<IRequirement> strictRequirementTo(VersionedId unit) {
    VersionRange strictRange = new VersionRange(unit.getVersion(), true, unit.getVersion(), true);
    IRequirement requirement = new RequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, unit.getId(), strictRange, null, false, false);
    return Collections.singleton(requirement);
}
Also used : IRequirement(org.eclipse.equinox.p2.metadata.IRequirement) RequiredCapability(org.eclipse.equinox.internal.p2.metadata.RequiredCapability) VersionRange(org.eclipse.equinox.p2.metadata.VersionRange)

Aggregations

ArrayList (java.util.ArrayList)2 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)2 VersionedId (org.eclipse.equinox.p2.metadata.VersionedId)2 RequiredCapability (org.eclipse.equinox.internal.p2.metadata.RequiredCapability)1 IRequirement (org.eclipse.equinox.p2.metadata.IRequirement)1 IVersionedId (org.eclipse.equinox.p2.metadata.IVersionedId)1 InstallableUnitDescription (org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription)1 VersionRange (org.eclipse.equinox.p2.metadata.VersionRange)1 PublisherInfo (org.eclipse.equinox.p2.publisher.PublisherInfo)1 PublisherResult (org.eclipse.equinox.p2.publisher.PublisherResult)1 JREAction (org.eclipse.equinox.p2.publisher.actions.JREAction)1 DependencySeed (org.eclipse.tycho.core.resolver.shared.DependencySeed)1