use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolTest method testExpandVersionsOfInclusionsWithQualifierLiterals.
@Test
public void testExpandVersionsOfInclusionsWithQualifierLiterals() throws Exception {
File productDefinition = resourceFile("publishers/products/inclusionsWithQualifiers.product");
subject = initPublisher(createBundleIU("test.plugin", "0.1.0.20141230"), createBundleIU("test.plugin", "1.1.0"), createFeatureIU("test.feature", "0.2.0.20141230"), createFeatureIU("test.feature", "1.2.0"));
IInstallableUnit unit = getUnit(subject.publishProduct(productDefinition, null, FLAVOR));
assertThat(unit.getRequirements(), hasItem(strictRequirement("test.plugin", "0.1.0.20141230")));
assertThat(unit.getRequirements(), hasItem(strictRequirement("test.feature.feature.group", "0.2.0.20141230")));
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolTest method testExpandVersionsOfInclusionsWithZeros.
@Test
public void testExpandVersionsOfInclusionsWithZeros() throws Exception {
File productDefinition = resourceFile("publishers/products/inclusionsWithZeros.product");
subject = initPublisher(createBundleIU("test.plugin", "0.1.0.20141230"), createBundleIU("test.plugin", "1.1.0"), createFeatureIU("test.feature", "0.2.0.20141230"), createFeatureIU("test.feature", "1.2.0"));
IInstallableUnit unit = getUnit(subject.publishProduct(productDefinition, null, FLAVOR));
assertThat(unit.getRequirements(), hasItem(strictRequirement("test.plugin", "1.1.0")));
assertThat(unit.getRequirements(), hasItem(strictRequirement("test.feature.feature.group", "1.2.0")));
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolTest method testPublishingWithRootFeatures.
@Test
public void testPublishingWithRootFeatures() {
File productDefinition = resourceFile("publishers/products/rootFeatures.product");
subject = initPublisher(createFeatureIU("org.eclipse.rcp", "4.4.0.v20140128"), createFeatureIU("org.eclipse.e4.rcp", "1.0"), createFeatureIU("org.eclipse.help", "2.0.102.v20140128"), createFeatureIU("org.eclipse.egit", "2.0"));
List<DependencySeed> seeds = subject.publishProduct(productDefinition, null, FLAVOR);
IInstallableUnit productUnit = getUnique(productUnit(), unitsIn(seeds));
assertThat(productUnit.getRequirements(), hasItem(requirement("org.eclipse.rcp.feature.group", "4.4.0.v20140128")));
assertThat(productUnit.getRequirements(), hasItem(requirement("org.eclipse.e4.rcp.feature.group", "1.0")));
assertThat(productUnit.getRequirements(), not(hasItem(requirement("org.eclipse.help.feature.group", "2.0.102.v20140128"))));
assertThat(productUnit.getRequirements(), not(hasItem(requirement("org.eclipse.egit.feature.group", "2.0"))));
assertThat(seeds.get(1).getId(), is("org.eclipse.help"));
assertThat((IInstallableUnit) seeds.get(1).getInstallableUnit(), is(unitWithId("org.eclipse.help.feature.group")));
assertThat(seeds.get(2).getId(), is("org.eclipse.egit"));
assertThat((IInstallableUnit) seeds.get(2).getInstallableUnit(), is(unitWithId("org.eclipse.egit.feature.group")));
assertThat(seeds, hasSize(3));
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublisherServiceTest method initSubject.
@Before
public void initSubject() throws Exception {
File projectDirectory = tempManager.newFolder("projectDir");
LinkedHashSet<IInstallableUnit> installableUnits = new LinkedHashSet<>();
installableUnits.add(InstallableUnitUtil.createFeatureIU("org.eclipse.example.original_feature", "1.0.0"));
IMetadataRepository context = new ImmutableInMemoryMetadataRepository(installableUnits);
// TODO these publishers don't produce artifacts, so we could run without file system
outputRepository = new PublishingRepositoryImpl(p2Context.getAgent(), new ReactorProjectIdentitiesStub(projectDirectory));
PublisherActionRunner publisherRunner = new PublisherActionRunner(context, DEFAULT_ENVIRONMENTS, logVerifier.getLogger());
subject = new PublisherServiceImpl(publisherRunner, DEFAULT_QUALIFIER, outputRepository);
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolImpl method addRootFeatures.
private static void addRootFeatures(ExpandedProduct product, List<DependencySeed> seeds) {
final String productId = product.getId();
// add root features as special dependency seed which are marked as "add-on" for the product
DependencySeed.Filter filter = new DependencySeed.Filter() {
@Override
public boolean isAddOnFor(String type, String id) {
return ArtifactType.TYPE_ECLIPSE_PRODUCT.equals(type) && productId.equals(id);
}
};
for (IInstallableUnit featureIU : product.getRootFeatures()) {
ArtifactKey featureArtifact = ArtifactTypeHelper.toTychoArtifact(featureIU);
seeds.add(new DependencySeed(featureArtifact.getType(), featureArtifact.getId(), featureIU, filter));
}
}
Aggregations