|
Lines 27-32
Link Here
|
| 27 |
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; |
27 |
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; |
| 28 |
import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; |
28 |
import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; |
| 29 |
import org.eclipse.equinox.p2.engine.IProvisioningPlan; |
29 |
import org.eclipse.equinox.p2.engine.IProvisioningPlan; |
|
|
30 |
import org.eclipse.equinox.p2.touchpoint.eclipse.query.OSGiBundleQuery; |
| 30 |
import org.eclipse.osgi.util.NLS; |
31 |
import org.eclipse.osgi.util.NLS; |
| 31 |
import org.eclipse.pde.internal.core.PDECore; |
32 |
import org.eclipse.pde.internal.core.PDECore; |
| 32 |
import org.eclipse.pde.internal.core.target.provisional.*; |
33 |
import org.eclipse.pde.internal.core.target.provisional.*; |
|
Lines 85-113
Link Here
|
| 85 |
private boolean fIncludeMultipleEnvironments = false; |
86 |
private boolean fIncludeMultipleEnvironments = false; |
| 86 |
|
87 |
|
| 87 |
/** |
88 |
/** |
| 88 |
* Query for bundles in a profile. Every IU that ends up being installed as a bundle |
|
|
| 89 |
* provides a capability in the name space "osgi.bundle". |
| 90 |
*/ |
| 91 |
class BundleQuery extends MatchQuery { |
| 92 |
|
| 93 |
/* (non-Javadoc) |
| 94 |
* @see org.eclipse.equinox.internal.provisional.p2.query.MatchQuery#isMatch(java.lang.Object) |
| 95 |
*/ |
| 96 |
public boolean isMatch(Object candidate) { |
| 97 |
if (candidate instanceof IInstallableUnit) { |
| 98 |
IInstallableUnit unit = (IInstallableUnit) candidate; |
| 99 |
IProvidedCapability[] provided = unit.getProvidedCapabilities(); |
| 100 |
for (int i = 0; i < provided.length; i++) { |
| 101 |
if (provided[i].getNamespace().equals("osgi.bundle")) { //$NON-NLS-1$ |
| 102 |
return true; |
| 103 |
} |
| 104 |
} |
| 105 |
} |
| 106 |
return false; |
| 107 |
} |
| 108 |
} |
| 109 |
|
| 110 |
/** |
| 111 |
* Constructs a installable unit bundle container for the specified units. |
89 |
* Constructs a installable unit bundle container for the specified units. |
| 112 |
* |
90 |
* |
| 113 |
* @param ids IU identifiers |
91 |
* @param ids IU identifiers |
|
Lines 265-271
Link Here
|
| 265 |
} |
243 |
} |
| 266 |
|
244 |
|
| 267 |
// query for bundles |
245 |
// query for bundles |
| 268 |
BundleQuery query = new BundleQuery(); |
246 |
OSGiBundleQuery query = new OSGiBundleQuery(); |
| 269 |
Collector collector = new Collector(); |
247 |
Collector collector = new Collector(); |
| 270 |
slice.query(query, collector, new SubProgressMonitor(subMonitor, 10)); |
248 |
slice.query(query, collector, new SubProgressMonitor(subMonitor, 10)); |
| 271 |
|
249 |
|
|
Lines 423-429
Link Here
|
| 423 |
} |
401 |
} |
| 424 |
|
402 |
|
| 425 |
// query for bundles |
403 |
// query for bundles |
| 426 |
collector = slice.query(new BundleQuery(), new Collector(), new SubProgressMonitor(subMonitor, 10)); |
404 |
collector = slice.query(new OSGiBundleQuery(), new Collector(), new SubProgressMonitor(subMonitor, 10)); |
| 427 |
|
405 |
|
| 428 |
if (subMonitor.isCanceled()) { |
406 |
if (subMonitor.isCanceled()) { |
| 429 |
return new IResolvedBundle[0]; |
407 |
return new IResolvedBundle[0]; |