diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.publisher.eclipse')
3 files changed, 23 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java index 87f7fd0a9..f3dc69b7f 100644 --- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java +++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java @@ -51,6 +51,11 @@ public interface IProductDescriptor { public List<IVersionedId> getBundles(boolean includeFragments); /** + * Returns <code>true</code> when <code>getBundles(includeFragments)</code> returns a non-empty list. + */ + public boolean hasBundles(boolean includeFragments); + + /** * Returns the fragments listed in the product. * @see #useFeatures() */ @@ -63,6 +68,11 @@ public interface IProductDescriptor { public List<IVersionedId> getFeatures(); /** + * Returns <code>true</code> when <code>getFeatures()</code> returns a non-empty list. + */ + public boolean hasFeatures(); + + /** * Returns the features listed in the product. Note: These features are only part of * the product if {@link #useFeatures()} returns <code>true</code>. * @param options bitmask to indicate what kind of features to return. @@ -188,4 +198,4 @@ public interface IProductDescriptor { */ public List<IRepositoryReference> getRepositoryEntries(); -}
\ No newline at end of file +} diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java index 109837b64..71816dc1e 100644 --- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java +++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java @@ -361,6 +361,11 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { return result; } + public boolean hasBundles(boolean includeFragments) { + // implement directly; don't call the potentially overridden getBundles + return !plugins.isEmpty() || (includeFragments && !fragments.isEmpty()); + } + private List<FeatureEntry> getBundleEntries(boolean includeFragments) { List<FeatureEntry> result = new LinkedList<FeatureEntry>(); result.addAll(plugins); @@ -398,6 +403,11 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { return getFeatures(INCLUDED_FEATURES); } + public boolean hasFeatures() { + // implement directly; don't call the potentially overridden getFeatures + return !features.isEmpty(); + } + public List<IVersionedId> getFeatures(int options) { List<IVersionedId> result = new LinkedList<IVersionedId>(); diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java index 650f1dd3c..edaa26842 100644 --- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java +++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java @@ -136,14 +136,14 @@ public class ProductAction extends AbstractPublisherAction { case FEATURES : // include features only list = versionElements(listElements(product.getFeatures(), ".feature.group"), IInstallableUnit.NAMESPACE_IU_ID); //$NON-NLS-1$ - if (!product.getBundles(true).isEmpty()) { + if (product.hasBundles(true)) { finalStatus.add(new Status(IStatus.INFO, Activator.ID, Messages.bundlesInProductFileIgnored)); } break; case BUNDLES : // include bundles only list = versionElements(listElements(product.getBundles(true), null), IInstallableUnit.NAMESPACE_IU_ID); - if (!product.getFeatures().isEmpty()) { + if (product.hasFeatures()) { finalStatus.add(new Status(IStatus.INFO, Activator.ID, Messages.featuresInProductFileIgnored)); } break; |