use of org.eclipse.equinox.p2.publisher.PublisherInfo in project tycho by eclipse.
the class FeatureDependenciesAction method addPublisherAdvice.
@Override
protected void addPublisherAdvice(IPublisherInfo publisherInfo) {
// see org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction.createAdviceFileAdvice(Feature, IPublisherInfo)
IPath location = new Path(feature.getLocation());
Version version = Version.parseVersion(feature.getVersion());
String groupId = getId();
AdviceFileAdvice advice = new AdviceFileAdvice(groupId, version, location, new Path("p2.inf"));
if (advice.containsAdvice()) {
publisherInfo.addAdvice(advice);
}
}
use of org.eclipse.equinox.p2.publisher.PublisherInfo in project tycho by eclipse.
the class ProductDependenciesAction method addPublisherAdvice.
@Override
protected void addPublisherAdvice(IPublisherInfo publisherInfo) {
// see org.eclipse.equinox.p2.publisher.eclipse.ProductAction.createAdviceFileAdvice()
File productFileLocation = product.getLocation();
if (productFileLocation == null) {
return;
}
String id = product.getId();
Version parseVersion = Version.parseVersion(product.getVersion());
IPath basePath = new Path(productFileLocation.getParent());
// must match org.eclipse.tycho.plugins.p2.publisher.PublishProductMojo.getSourceP2InfFile(File)
final String productFileName = productFileLocation.getName();
final String p2infFilename = productFileName.substring(0, productFileName.length() - ".product".length()) + ".p2.inf";
AdviceFileAdvice advice = new AdviceFileAdvice(id, parseVersion, basePath, new Path(p2infFilename));
if (advice.containsAdvice()) {
publisherInfo.addAdvice(advice);
}
}
use of org.eclipse.equinox.p2.publisher.PublisherInfo 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.publisher.PublisherInfo in project tycho by eclipse.
the class PublisherActionRunner method executeAction.
public Collection<IInstallableUnit> executeAction(IPublisherAction action, IMetadataRepository metadataOutput, IArtifactRepository artifactOutput, IPublisherAdvice... advice) {
ResultSpyAction resultSpy = new ResultSpyAction();
IPublisherAction[] actions = new IPublisherAction[] { action, resultSpy };
/**
* The PublisherInfo must not be cached, or results may leak between publishing actions (see
* bug 346532).
*/
IPublisherInfo publisherInfo = newPublisherInfo(metadataOutput, artifactOutput);
for (IPublisherAdvice adviceItem : advice) {
publisherInfo.addAdvice(adviceItem);
}
Publisher publisher = new Publisher(publisherInfo);
IStatus result = publisher.publish(actions, null);
handlePublisherStatus(result);
return resultSpy.getAllIUs();
}
Aggregations