use of org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription in project tycho by eclipse.
the class StandardEEResolutionHints method newIU.
private static IInstallableUnit newIU(String id, Version version) {
InstallableUnitDescription iud = new InstallableUnitDescription();
iud.setId(id);
iud.setVersion(version);
iud.addProvidedCapabilities(Collections.singleton(MetadataFactory.createProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, id, version)));
return MetadataFactory.createInstallableUnit(iud);
}
use of org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription in project tycho by eclipse.
the class AbstractSlicerResolutionStrategy method createUnitRequiring.
protected static IInstallableUnit createUnitRequiring(String name, Collection<IInstallableUnit> units, Collection<IRequirement> additionalRequirements) {
InstallableUnitDescription result = new MetadataFactory.InstallableUnitDescription();
String time = Long.toString(System.currentTimeMillis());
result.setId(name + "-" + time);
result.setVersion(Version.createOSGi(0, 0, 0, time));
ArrayList<IRequirement> requirements = new ArrayList<>();
if (units != null) {
for (IInstallableUnit unit : units) {
requirements.add(createStrictRequirementTo(unit));
}
}
if (additionalRequirements != null) {
requirements.addAll(additionalRequirements);
}
result.addRequirements(requirements);
return MetadataFactory.createInstallableUnit(result);
}
use of org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription in project tycho by eclipse.
the class InstallableUnitUtil method createIUArtifact.
public static IInstallableUnit createIUArtifact(String id, String version, String artifactId, String artifactVersion) {
InstallableUnitDescription description = createIuDescription(id, version);
description.setArtifacts(new IArtifactKey[] { new ArtifactKey("type", artifactId, Version.create(artifactVersion)) });
return MetadataFactory.createInstallableUnit(description);
}
use of org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription in project tycho by eclipse.
the class InstallableUnitUtil method createIUWithCapabilitiesAndFilter.
public static IInstallableUnit createIUWithCapabilitiesAndFilter(String id, String version, Collection<IProvidedCapability> capabilities, String filter) {
InstallableUnitDescription description = createIuDescription(id, version);
description.addProvidedCapabilities(capabilities);
description.setFilter(filter);
return MetadataFactory.createInstallableUnit(description);
}
use of org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription in project tycho by eclipse.
the class InstallableUnitUtil method createIuDescription.
private static InstallableUnitDescription createIuDescription(String id, String version) {
InstallableUnitDescription description = new InstallableUnitDescription();
description.setId(id);
description.setVersion(Version.create(version));
description.addProvidedCapabilities(createProvidedCapability(IU_CAPABILITY_NS, id, version));
return description;
}
Aggregations