use of org.eclipse.equinox.p2.publisher.PublisherResult in project tycho by eclipse.
the class AbstractMetadataGenerator method publish.
private DependencyMetadata publish(PublisherInfo publisherInfo, List<IPublisherAction> actions) {
PublisherResult result = new PublisherResult();
Publisher publisher = new Publisher(publisherInfo, result);
IStatus status = publisher.publish(actions.toArray(new IPublisherAction[actions.size()]), monitor);
if (!status.isOK()) {
throw new RuntimeException(StatusTool.collectProblems(status), status.getException());
}
DependencyMetadata metadata = new DependencyMetadata();
metadata.setMetadata(true, result.getIUs(null, PublisherResult.ROOT));
metadata.setMetadata(false, result.getIUs(null, PublisherResult.NON_ROOT));
IArtifactRepository artifactRepository = publisherInfo.getArtifactRepository();
if (artifactRepository instanceof TransientArtifactRepository) {
metadata.setArtifacts(((TransientArtifactRepository) artifactRepository).getArtifactDescriptors());
}
return metadata;
}
use of org.eclipse.equinox.p2.publisher.PublisherResult in project tycho by eclipse.
the class CustomEEResolutionHintsTest method testConsistencyWithJREAction.
@Test
public void testConsistencyWithJREAction() throws Exception {
JREAction jreAction = new JREAction(resourceFile("profiles/TestMe-1.8.profile"));
PublisherResult results = new PublisherResult();
jreAction.perform(new PublisherInfo(), results, null);
Set<IInstallableUnit> publishedUnits = results.query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet();
subject = new CustomEEResolutionHints("TestMe-1.8");
for (IInstallableUnit unit : publishedUnits) {
if (subject.isEESpecificationUnit(unit)) {
// success: we find the unit create by the JREAction
return;
}
}
fail("'a.jre' unit for profile 'TestMe-1.8' not found in" + publishedUnits);
}
use of org.eclipse.equinox.p2.publisher.PublisherResult 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());
}
}
Aggregations