/** * Create advice for a p2.inf file co-located with the product file, if any. */ private void createAdviceFileAdvice() { File productFileLocation = product.getLocation(); if (productFileLocation == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(product.getId(), Version.parseVersion(product.getVersion()), new Path(productFileLocation.getParent()), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) info.addAdvice(advice); }
this.version = version; Map<String, String> advice = loadAdviceMap(basePath, adviceFilePath); if (advice.isEmpty()) return;
this.version = version; Map<String, String> advice = loadAdviceMap(basePath, adviceFilePath); if (advice.isEmpty()) return;
/** * Create advice for a p2.inf file co-located with the product file, if any. */ private void createAdviceFileAdvice() { File productFileLocation = product.getLocation(); if (productFileLocation == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(product.getId(), Version.parseVersion(product.getVersion()), new Path(productFileLocation.getParent()), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) info.addAdvice(advice); }
this.version = version; Map<String, String> advice = loadAdviceMap(basePath, adviceFilePath); if (advice.isEmpty()) return;
/** * Create advice for a p2.inf file co-located with the product file, if any. */ private void createAdviceFileAdvice() { File productFileLocation = product.getLocation(); if (productFileLocation == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(product.getId(), Version.parseVersion(product.getVersion()), new Path(productFileLocation.getParent()), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) info.addAdvice(advice); }
this.version = version; Map<String, String> advice = loadAdviceMap(basePath, adviceFilePath); if (advice.isEmpty()) return;
/** * Adds advice for any p2.inf file found in this bundle. */ protected void createAdviceFileAdvice(BundleDescription bundleDescription, IPublisherInfo publisherInfo) { String location = bundleDescription.getLocation(); if (location == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundleDescription.getVersion()), new Path(location), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) publisherInfo.addAdvice(advice); }
@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); } }
@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); } }
/** * Looks for advice in a p2.inf file inside the feature location. */ private void createAdviceFileAdvice(Feature feature, IPublisherInfo publisherInfo) { //assume p2.inf is co-located with feature.xml String location = feature.getLocation(); if (location != null) { String groupId = getTransformedId(feature.getId(), /*isPlugin*/false, /*isGroup*/true); AdviceFileAdvice advice = new AdviceFileAdvice(groupId, Version.parseVersion(feature.getVersion()), new Path(location), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) publisherInfo.addAdvice(advice); } }
/** * Adds advice for any p2.inf file found in this bundle. */ private void createAdviceFileAdvice(BundleDescription bundleDescription, IPublisherInfo publisherInfo) { String location = bundleDescription.getLocation(); if (location == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundleDescription.getVersion()), new Path(location), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) publisherInfo.addAdvice(advice); }
/** * Adds advice for any p2.inf file found in this bundle. */ protected void createAdviceFileAdvice(BundleDescription bundleDescription, IPublisherInfo publisherInfo) { String location = bundleDescription.getLocation(); if (location == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundleDescription.getVersion()), new Path(location), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) publisherInfo.addAdvice(advice); }
/** * Looks for advice in a p2.inf file inside the feature location. */ private void createAdviceFileAdvice(Feature feature, IPublisherInfo publisherInfo) { //assume p2.inf is co-located with feature.xml String location = feature.getLocation(); if (location != null) { String groupId = getTransformedId(feature.getId(), /*isPlugin*/false, /*isGroup*/true); AdviceFileAdvice advice = new AdviceFileAdvice(groupId, Version.parseVersion(feature.getVersion()), new Path(location), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) publisherInfo.addAdvice(advice); } }
/** * Looks for advice in a p2.inf file inside the feature location. */ private void createAdviceFileAdvice(Feature feature, IPublisherInfo publisherInfo) { //assume p2.inf is co-located with feature.xml String location = feature.getLocation(); if (location != null) { String groupId = getTransformedId(feature.getId(), /*isPlugin*/false, /*isGroup*/true); AdviceFileAdvice advice = new AdviceFileAdvice(groupId, Version.parseVersion(feature.getVersion()), new Path(location), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) publisherInfo.addAdvice(advice); } }
/** * Returns an IU corresponding to the given artifact key and bundle, or <code>null</code> * if an IU could not be created. */ public static IInstallableUnit createBundleIU(IArtifactKey artifactKey, File bundleFile) { BundleDescription bundleDescription = BundlesAction.createBundleDescriptionIgnoringExceptions(bundleFile); if (bundleDescription == null) return null; PublisherInfo info = new PublisherInfo(); Version version = Version.create(bundleDescription.getVersion().toString()); AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), version, new Path(bundleFile.getAbsolutePath()), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) info.addAdvice(advice); String shape = bundleFile.isDirectory() ? IBundleShapeAdvice.DIR : IBundleShapeAdvice.JAR; info.addAdvice(new BundleShapeAdvice(bundleDescription.getSymbolicName(), version, shape)); return BundlesAction.createBundleIU(bundleDescription, artifactKey, info); }
/** * Returns an IU corresponding to the given artifact key and bundle, or <code>null</code> * if an IU could not be created. */ public static IInstallableUnit createBundleIU(IArtifactKey artifactKey, File bundleFile) { BundleDescription bundleDescription = BundlesAction.createBundleDescriptionIgnoringExceptions(bundleFile); if (bundleDescription == null) return null; PublisherInfo info = new PublisherInfo(); Version version = Version.create(bundleDescription.getVersion().toString()); AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), version, new Path(bundleFile.getAbsolutePath()), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) info.addAdvice(advice); String shape = bundleFile.isDirectory() ? IBundleShapeAdvice.DIR : IBundleShapeAdvice.JAR; info.addAdvice(new BundleShapeAdvice(bundleDescription.getSymbolicName(), version, shape)); return BundlesAction.createBundleIU(bundleDescription, artifactKey, info); }