Interface IBundleProjectService
An instance of this service can be obtained from a ServiceCaller
as
follows
ServiceCaller.callOnce(getClass(), IBundleContextService.class, (service) -> ...);
- Since:
- 3.6
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptiongetDescription
(IProject project) Returns a bundle description for the given project.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.default IHostDescription
newHost
(String name, VersionRange range) Deprecated, for removal: This API element is subject to removal in a future version.newHost
(String name, VersionRange range) Creates and returns a new host description.default IPackageExportDescription
newPackageExport
(String name, Version version, boolean api, String[] friends) Deprecated.newPackageExport
(String name, Version version, boolean api, Collection<String> friends) Constructs a new package export description.default IPackageImportDescription
newPackageImport
(String name, VersionRange range, boolean optional) Deprecated, for removal: This API element is subject to removal in a future version.Instead usenewPackageImport(String, VersionRange, boolean)
newPackageImport
(String name, VersionRange range, boolean optional) Creates and returns a new package import description.default IRequiredBundleDescription
newRequiredBundle
(String name, VersionRange range, boolean optional, boolean export) Deprecated, for removal: This API element is subject to removal in a future version.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, ornull
to indicate the default bundle root location should be used (project folder).
-
Method Details
-
getDescription
Returns a bundle description for the given project. If the project does not exist, the description can be used to create a new bundle project. If the project does exist, the description can be used to modify a project.- Parameters:
project
- project- Returns:
- bundle description for the associated project
- Throws:
CoreException
- if unable to create a description on an existing project
-
newHost
Creates and returns a new host description.- Parameters:
name
- symbolic name of the hostrange
- version constraint ornull
- Returns:
- host description
- Since:
- 3.19
-
newHost
@Deprecated(forRemoval=true, since="3.19 (removal in 2026-09 or later)") default IHostDescription newHost(String name, VersionRange range) Deprecated, for removal: This API element is subject to removal in a future version.Instead usenewHost(String, VersionRange)
-
newPackageImport
Creates and returns a new package import description.- Parameters:
name
- fully qualified name of imported packagerange
- version constraint ornull
optional
- whether the import is optional- Returns:
- package import description
- Since:
- 3.19
-
newPackageImport
@Deprecated(forRemoval=true, since="3.19 (removal in 2026-09 or later)") default IPackageImportDescription newPackageImport(String name, VersionRange range, boolean optional) Deprecated, for removal: This API element is subject to removal in a future version.Instead usenewPackageImport(String, VersionRange, boolean)
-
newPackageExport
IPackageExportDescription newPackageExport(String name, Version version, boolean api, Collection<String> friends) Constructs a new package export description.- Parameters:
name
- fully qualified package nameversion
- version ornull
api
- whether the package is considered APIfriends
- symbolic names of bundles that are friends; when friends are specified the package will not be API- Returns:
- package export description
- Since:
- 3.19
-
newPackageExport
@Deprecated(since="3.19") default IPackageExportDescription newPackageExport(String name, Version version, boolean api, String[] friends) Deprecated. -
newRequiredBundle
IRequiredBundleDescription newRequiredBundle(String name, VersionRange range, boolean optional, boolean export) Creates and returns a new required bundle description.- Parameters:
name
- symbolic name of required bundlerange
- version constraint ornull
optional
- whether the required bundle is optionalexport
- whether the required bundle is re-exported- Returns:
- required bundle description
- Since:
- 3.19
-
newRequiredBundle
@Deprecated(forRemoval=true, since="3.19 (removal in 2026-09 or later)") default IRequiredBundleDescription newRequiredBundle(String name, VersionRange range, boolean optional, boolean export) Deprecated, for removal: This API element is subject to removal in a future version. -
newBundleClasspathEntry
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.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.- Parameters:
sourceFolder
- source folder ornull
binaryFolder
- binary folder ornull
library
- associated entry on the Bundle-Classpath header ornull
to indicate default entry "."- Returns:
- a new bundle classpath entry
-
setBundleRoot
Sets the location within the project where the root of the bundle and its associated artifacts will reside, ornull
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 projectIBundleProjectDescription.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.- Parameters:
project
- project that must exist and be openbundleRoot
- project relative path to bundle root artifacts in the project ornull
- Throws:
CoreException
- if setting the root fails
-
newHost(String, VersionRange)