use of org.eclipse.equinox.p2.publisher.IPublisherAdvice in project tycho by eclipse.
the class P2GeneratorImpl method getPublisherAdvice.
@Override
protected List<IPublisherAdvice> getPublisherAdvice(IArtifactFacade artifact) {
ArrayList<IPublisherAdvice> advice = new ArrayList<>();
advice.add(new MavenPropertiesAdvice(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getClassifier()));
advice.add(getExtraEntriesAdvice(artifact));
IFeatureRootAdvice featureRootAdvice = FeatureRootAdvice.createRootFileAdvice(artifact, getBuildPropertiesParser());
if (featureRootAdvice != null) {
advice.add(featureRootAdvice);
}
return advice;
}
use of org.eclipse.equinox.p2.publisher.IPublisherAdvice in project tycho by eclipse.
the class PublishProductToolImpl method publishProduct.
@Override
public List<DependencySeed> publishProduct(File productFile, File launcherBinaries, String flavor) throws IllegalArgumentException {
IProductDescriptor originalProduct = loadProductFile(productFile);
ExpandedProduct expandedProduct = new ExpandedProduct(originalProduct, buildQualifier, targetPlatform, interpolator, logger);
IPublisherAdvice[] advice = getProductSpecificAdviceFileAdvice(productFile, expandedProduct);
ProductAction action = new ProductAction(null, expandedProduct, flavor, launcherBinaries);
IMetadataRepository metadataRepository = publishingRepository.getMetadataRepository();
IArtifactRepository artifactRepository = publishingRepository.getArtifactRepositoryForWriting(new ProductBinariesWriteSession(expandedProduct.getId()));
Collection<IInstallableUnit> allIUs = publisherRunner.executeAction(action, metadataRepository, artifactRepository, advice);
List<DependencySeed> seeds = new ArrayList<>();
seeds.add(createSeed(ArtifactType.TYPE_ECLIPSE_PRODUCT, selectUnit(allIUs, expandedProduct.getId())));
addRootFeatures(expandedProduct, seeds);
return seeds;
}
use of org.eclipse.equinox.p2.publisher.IPublisherAdvice 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