Class Export

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
aQute.bnd.gradle.AbstractBndrun
aQute.bnd.gradle.Export
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

public class Export extends AbstractBndrun
Export task type for Gradle.

This task type can be used to export a bndrun file.

Here is examples of using the Export task type:

 import aQute.bnd.gradle.Export
 tasks.register("exportExecutable", Export) {
   bndrun = file("my.bndrun")
   exporter = "bnd.executablejar"
 }
 tasks.register("exportRunbundles", Export) {
   bndrun = file("my.bndrun")
   exporter = "bnd.runbundles"
 }
 

Properties:

  • bndrun - This is the bndrun file to be exported. This property must be set.
  • bundles - The bundles to added to a FileSetRepository for non-Bnd Workspace builds. The default is "sourceSets.main.runtimeClasspath" plus "configurations.archives.artifacts.files". This must not be used for Bnd Workspace builds.
  • ignoreFailures - If true the task will not fail if the export fails. The default is false.
  • workingDirectory - This is the directory for the export operation. The default for workingDirectory is temporaryDir.
  • properties - Properties that are available for evaluation of the bnd instructions for non-Bnd Workspace builds. The default is the properties of the task and project objects. This must not be used for Bnd Workspace builds.
  • destinationDirectory - This is the directory for the output. The default for destinationDirectory is project.base.distsDirectory.dir("executable") if the exporter is "bnd.executablejar", project.base.distsDirectory.dir("runbundles"/bndrun) if the exporter is "bnd.runbundles", and project.base.distsDirectory.dir(task.name) for all other exporters.
  • exporter - The name of the exporter plugin to use. Bnd has two built-in exporter plugins. "bnd.executablejar" exports an executable jar and "bnd.runbundles" exports the -runbundles files. The default is "bnd.executablejar".
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Task

    org.gradle.api.Task.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a Export task.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated.
    Replaced by exporter.
    org.gradle.api.file.DirectoryProperty
    The destination directory for the export.
    org.gradle.api.provider.Property<String>
    The name of the exporter for this task.
    boolean
    Deprecated.
    Replaced by exporter.
    void
    setBundlesOnly(boolean bundlesOnly)
    Deprecated.
    Replaced by exporter.
    protected void
    worker(aQute.bnd.build.Project run)
    Export the Project object.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getReasonNotToTrackState, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, getConvention
  • Constructor Details

    • Export

      public Export()
      Create a Export task.
  • Method Details

    • isBundlesOnly

      @ReplacedBy("exporter") @Deprecated public boolean isBundlesOnly()
      Deprecated.
      Replaced by exporter.
      Returns:
      bundlesOnly
    • getBundlesOnly

      @Internal @Deprecated public boolean getBundlesOnly()
      Deprecated.
      Replaced by exporter.
      Returns:
      bundlesOnly
    • setBundlesOnly

      @Deprecated public void setBundlesOnly(boolean bundlesOnly)
      Deprecated.
      Replaced by exporter.
      Parameters:
      bundlesOnly - Replaced by exporter.
    • getDestinationDirectory

      @OutputDirectory public org.gradle.api.file.DirectoryProperty getDestinationDirectory()
      The destination directory for the export.

      The default for destinationDirectory is project.base.distsDirectory.dir("executable") if the exporter is "bnd.executablejar", project.base.distsDirectory.dir("runbundles"/bndrun) if the exporter is "bnd.runbundles", and project.base.distsDirectory.dir(task.name) for all other exporters.

      Returns:
      The destination directory for the export.
    • getExporter

      @Input public org.gradle.api.provider.Property<String> getExporter()
      The name of the exporter for this task.

      Bnd has two built-in exporter plugins. "bnd.executablejar" exports an executable jar and "bnd.runbundles" exports the -runbundles files. The default is "bnd.executablejar" unless bundlesOnly is false when the default is "bnd.runbundles".

      Returns:
      The name of the exporter for this task.
    • worker

      protected void worker(aQute.bnd.build.Project run) throws Exception
      Export the Project object.
      Specified by:
      worker in class AbstractBndrun
      Parameters:
      run - The Project object.
      Throws:
      Exception - If the worker action has an exception.