Search in sources :

Example 1 with AdviceFileAdvice

use of org.eclipse.equinox.p2.publisher.AdviceFileAdvice 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);
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) Version(org.eclipse.equinox.p2.metadata.Version) AdviceFileAdvice(org.eclipse.equinox.p2.publisher.AdviceFileAdvice)

Example 2 with AdviceFileAdvice

use of org.eclipse.equinox.p2.publisher.AdviceFileAdvice 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);
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) Version(org.eclipse.equinox.p2.metadata.Version) ProductFile(org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile) File(java.io.File) AdviceFileAdvice(org.eclipse.equinox.p2.publisher.AdviceFileAdvice)

Aggregations

IPath (org.eclipse.core.runtime.IPath)2 Path (org.eclipse.core.runtime.Path)2 Version (org.eclipse.equinox.p2.metadata.Version)2 AdviceFileAdvice (org.eclipse.equinox.p2.publisher.AdviceFileAdvice)2 File (java.io.File)1 ProductFile (org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile)1