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;
}
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;
}
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());
}
}
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);
}
Aggregations