Class BundleTaskExtension
Adds bundle extension to bundle builder tasks.
Properties:
- bndfile - This is the name of the bnd file to use to make the bundle. The bndfile does not need to exist. It will override headers in the jar task's manifest.
- bnd - This is a string holding a bnd file to use to make the bundle. It will override headers in the jar task's manifest. This properties is ignored if bndfile is specified and the specified file exists.
- sourceSet - This is the SourceSet to use for the bnd builder. It defaults to "project.sourceSets.main".
- classpath - This is the FileCollection to use for the buildpath for the bnd builder. It defaults to "project.sourceSets.main.compileClasspath".
- properties - Properties that are available for evaluation of the bnd instructions. The default is the properties of the task and project objects.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBundleTaskExtension(org.gradle.api.tasks.bundling.Jar task) Create a BundleTaskExtension for the specified Jar task. -
Method Summary
Modifier and TypeMethodDescriptionvoidbnd(CharSequence... lines) Add instructions to the bnd property from a list of multi-line strings.voidAdd instructions to the bnd property from a map.voidbnd(org.gradle.api.provider.Provider<? extends CharSequence> lines) Add a multi-line string of instructions to the bnd property using aProvider.org.gradle.api.Action<org.gradle.api.Task>Return the Action to build the bundle for the task.org.gradle.api.file.ConfigurableFileCollectionAdd files to the classpath.org.gradle.api.provider.Provider<String>getBnd()The bnd property.org.gradle.api.file.RegularFilePropertyThe bndfile property.org.gradle.api.file.ConfigurableFileCollectionThe classpath property.Properties that are available for evaluation of the bnd instructions.voidsetBnd(CharSequence line) Set the bnd property from a multi-line string.voidSet the bnd property from a map.voidsetBnd(org.gradle.api.provider.Provider<? extends CharSequence> lines) Set the bnd property from a multi-line string using aProvider.voidsetClasspath(Object path) Set the classpath property.voidsetSourceSet(org.gradle.api.tasks.SourceSet sourceSet) Set the sourceSet.
-
Field Details
-
NAME
Name of the extension.- See Also:
-
-
Constructor Details
-
BundleTaskExtension
public BundleTaskExtension(org.gradle.api.tasks.bundling.Jar task) Create a BundleTaskExtension for the specified Jar task.This also sets the default values for the added properties and adds the bnd file to the task inputs.
- Parameters:
task- The Jar task for this extension.
-
-
Method Details
-
getBndfile
@InputFile @PathSensitive(RELATIVE) @NormalizeLineEndings @Optional public org.gradle.api.file.RegularFileProperty getBndfile()The bndfile property.A bnd file containing bnd instructions for this project.
- Returns:
- The property for the bndfile.
-
getClasspath
@InputFiles @Classpath public org.gradle.api.file.ConfigurableFileCollection getClasspath()The classpath property.The default value is sourceSets.main.compileClasspath.
- Returns:
- The property for the classpath.
-
getBnd
The bnd property.If the bndfile property points an existing file, this property is ignored. Otherwise, the bnd instructions in this property will be used.
- Returns:
- The property for the bnd instructions.
-
getProperties
Properties that are available for evaluation of the bnd instructions.If this property is not set, the properties of the following are available:
task- The Task object of this extension.
project- The Project object for the task of this extension.
taskproperty is not set, the properties of the Task object of this extension will automatically be available.The following properties are set by the builder and are also available:
project.dir- The project directory.
project.output- The build directory.
project.buildpath- The project buildpath.
project.sourcepath<- The project sourcepath.
Note: The defaults for this property use the Project object which makes the task ineligible for the Gradle configuration cache. If you want to use this task with the Gradle configuration cache, you must set this property to ensure it does not use the Project object. Of course, this then means you cannot use
${project.xxx}style expressions in the bnd instructions unless you set those values in this property.- Returns:
- Properties available for evaluation of the bnd instructions.
-
setBnd
Set the bnd property from a multi-line string.- Parameters:
line- bnd instructions.
-
bnd
Add instructions to the bnd property from a list of multi-line strings.- Parameters:
lines- bnd instructions.
-
setBnd
Set the bnd property from a multi-line string using aProvider.- Parameters:
lines- A provider of bnd instructions.
-
bnd
Add a multi-line string of instructions to the bnd property using aProvider.- Parameters:
lines- A provider bnd instructions.
-
setBnd
Set the bnd property from a map.- Parameters:
map- A map of bnd instructions.
-
bnd
Add instructions to the bnd property from a map.- Parameters:
map- A map of bnd instructions.
-
classpath
Add files to the classpath.- Parameters:
paths- The arguments will be handled using ConfigurableFileCollection.from().- Returns:
- The property for the classpath.
-
setClasspath
Set the classpath property.- Parameters:
path- The argument will be handled using ConfigurableFileCollection.from().
-
setSourceSet
public void setSourceSet(org.gradle.api.tasks.SourceSet sourceSet) Set the sourceSet.- Parameters:
sourceSet- A sourceSet to use to find source code.
-
buildAction
public org.gradle.api.Action<org.gradle.api.Task> buildAction()Return the Action to build the bundle for the task.- Returns:
- The Action to build the bundle for the task.
-