public interface IBundleProjectService
An instance of this service can be obtained from a BundleContext
as
follows
BundleContext context = ... ServiceReference ref = context.getServiceReference(IBundleContextService.class.getName()); IBundleContextService service = (IBundleContextService)context.getService(ref); ... context.ungetService(ref);
Modifier and Type | Method and Description |
---|---|
IBundleProjectDescription |
getDescription(IProject project)
Returns a bundle description for the given project.
|
IBundleClasspathEntry |
newBundleClasspathEntry(IPath sourceFolder,
IPath binaryFolder,
IPath library)
Creates and returns a new bundle classpath entry defining the relationship
between a source, binaries, and library on the Bundle-Classpath header.
|
IHostDescription |
newHost(String name,
VersionRange range)
Creates and returns a new host description.
|
IPackageExportDescription |
newPackageExport(String name,
Version version,
boolean api,
String[] friends)
Constructs a new package export description.
|
IPackageImportDescription |
newPackageImport(String name,
VersionRange range,
boolean optional)
Creates and returns a new package import description.
|
IRequiredBundleDescription |
newRequiredBundle(String name,
VersionRange range,
boolean optional,
boolean export)
Creates and returns a new required bundle description.
|
void |
setBundleRoot(IProject project,
IPath bundleRoot)
Sets the location within the project where the root of the bundle and its associated
artifacts will reside, or
null to indicate the default bundle root location
should be used (project folder). |
IBundleProjectDescription getDescription(IProject project) throws CoreException
project
- projectCoreException
- if unable to create a description on an existing projectIHostDescription newHost(String name, VersionRange range)
name
- symbolic name of the hostrange
- version constraint or null
IPackageImportDescription newPackageImport(String name, VersionRange range, boolean optional)
name
- fully qualified name of imported packagerange
- version constraint or null
optional
- whether the import is optionalIPackageExportDescription newPackageExport(String name, Version version, boolean api, String[] friends)
name
- fully qualified package nameversion
- version or null
api
- whether the package is considered APIfriends
- symbolic names of bundles that are friends, or null
; when
friends are specified the package will not be APIIRequiredBundleDescription newRequiredBundle(String name, VersionRange range, boolean optional, boolean export)
name
- symbolic name of required bundlerange
- version constraint or null
optional
- whether the required bundle is optionalexport
- whether the required bundle is re-exportedIBundleClasspathEntry newBundleClasspathEntry(IPath sourceFolder, IPath binaryFolder, IPath library)
When a source folder is specified, the binary folder defines its output
folder, or may be null
to indicate that the project's default output
folder is used by the source folder. When only a binary folder is specified, there
is no source associated with the folder. When no source or binary are specified,
it indicates the library is included in the project as an archive.
sourceFolder
- source folder or null
binaryFolder
- binary folder or null
library
- associated entry on the Bundle-Classpath header or null
to indicate default entry "."void setBundleRoot(IProject project, IPath bundleRoot) throws CoreException
null
to indicate the default bundle root location
should be used (project folder).
The bundle root is the folder containing the META-INF/
folder. When the bundle
root location is modified, existing bundle artifacts at the old root are not moved or modified.
When creating a new bundle project IBundleProjectDescription.setBundleRoot(IPath)
can
be used to specify an initial bundle root location. To modify the bundle root location of an
existing project, this method must be used.
project
- project that must exist and be openbundleRoot
- project relative path to bundle root artifacts in the project or null
CoreException
- if setting the root fails
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.