Class AbstractBndrun

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
aQute.bnd.gradle.AbstractBndrun
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>
Direct Known Subclasses:
Bndrun, Export, Resolve, TestOSGi

public abstract class AbstractBndrun extends org.gradle.api.DefaultTask
Abstract Bndrun task type for Gradle.

This abstract task type is the super type of the bndrun based task types.

Properties:

  • bndrun - This is the bndrun file to be run. 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 execution fails. The default is false.
  • workingDirectory - This is the directory for the execution. 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.
  • 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 Bndrun task.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Setup the Run object and call worker on it.
    org.gradle.api.file.ConfigurableFileCollection
    bundles(Object... paths)
    Add files to use when locating bundles.
    protected biz.aQute.resolve.Bndrun
    createBndrun(aQute.bnd.build.Workspace workspace, File bndrunFile)
    Create the RUN object.
    org.gradle.api.file.RegularFileProperty
    The bndrun file for the execution.
    org.gradle.api.file.ConfigurableFileCollection
    The bundles to be added to a FileSetRepository for non-Bnd Workspace builds.
    boolean
    Whether execution failures should be ignored.
    org.gradle.api.provider.MapProperty<String,Object>
    Properties that are available for evaluation of the bnd instructions for non-Bnd Workspace builds.
    org.gradle.api.file.DirectoryProperty
    The working directory for the execution.
    protected void
    inferRunEE(aQute.bnd.osgi.Processor run)
    Set -runee from the build environment if not already set in the Processor object.
    protected void
    inferRunRequires(aQute.bnd.osgi.Processor run)
    Set -runrequires from the build environment if not already set in the Processor object.
    boolean
    Whether execution failures should be ignored.
    void
    Set the files to use when locating bundles.
    void
    setIgnoreFailures(boolean ignoreFailures)
    Set whether execution failures should be ignored.
    protected abstract void
    worker(aQute.bnd.build.Project run)
    Execute 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

    • AbstractBndrun

      public AbstractBndrun()
      Create a Bndrun task.
  • Method Details

    • getBndrun

      @InputFile @PathSensitive(RELATIVE) @NormalizeLineEndings public org.gradle.api.file.RegularFileProperty getBndrun()
      The bndrun file for the execution.
      Returns:
      The bndrun file for the execution.
    • getBundles

      @InputFiles @PathSensitive(RELATIVE) public org.gradle.api.file.ConfigurableFileCollection getBundles()
      The bundles to be added to a FileSetRepository for non-Bnd Workspace builds.

      This must not be used for Bnd Workspace builds.

      Returns:
      The bundles to be added to a FileSetRepository for non-Bnd Workspace builds.
    • isIgnoreFailures

      @Input public boolean isIgnoreFailures()
      Whether execution failures should be ignored.
      Returns:
      true if execution failures will not fail the task. Otherwise, an execution failure will fail the task. The default is false.
    • getIgnoreFailures

      @Internal public boolean getIgnoreFailures()
      Whether execution failures should be ignored.

      Alias for isIgnoreFailures().

      Returns:
      true if execution failures will not fail the task. Otherwise, an execution failure will fail the task. The default is false.
    • setIgnoreFailures

      public void setIgnoreFailures(boolean ignoreFailures)
      Set whether execution failures should be ignored.
      Parameters:
      ignoreFailures - If true, then execution failures will not fail the task. Otherwise, an execution failure will fail the task. The default is false.
    • getWorkingDirectory

      @Internal public org.gradle.api.file.DirectoryProperty getWorkingDirectory()
      The working directory for the execution.
      Returns:
      The working directory for the execution.
    • getProperties

      @Input public org.gradle.api.provider.MapProperty<String,Object> getProperties()
      Properties that are available for evaluation of the bnd instructions for non-Bnd Workspace builds.

      This must not be used for Bnd Workspace builds.

      If this property is not set, the properties of the following are available:

      task
      This Task object.
      project
      The Project object for this task.
      If the task property is not set, the properties of this Task object will automatically be available.

      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.
    • bundles

      public org.gradle.api.file.ConfigurableFileCollection bundles(Object... paths)
      Add files to use when locating bundles.
      Parameters:
      paths - The arguments will be handled using ConfigurableFileCollection.from().
      Returns:
      The bundles to be added to a FileSetRepository for non-Bnd Workspace builds.
    • setBundles

      public void setBundles(Object path)
      Set the files to use when locating bundles.

      The argument will be handled using ConfigurableFileCollection.from().

      Parameters:
      path - The argument will be handled using ConfigurableFileCollection.from().
    • bndrunAction

      public void bndrunAction() throws Exception
      Setup the Run object and call worker on it.
      Throws:
      Exception - If the run action has an exception.
    • createBndrun

      protected biz.aQute.resolve.Bndrun createBndrun(aQute.bnd.build.Workspace workspace, File bndrunFile) throws Exception
      Create the RUN object.
      Parameters:
      workspace - The workspace for the RUN.
      bndrunFile - The bndrun file for the RUN.
      Returns:
      The RUN object.
      Throws:
      Exception - If the create action has an exception.
    • worker

      protected abstract void worker(aQute.bnd.build.Project run) throws Exception
      Execute the Project object.
      Parameters:
      run - The Project object.
      Throws:
      Exception - If the worker action has an exception.
    • inferRunEE

      protected void inferRunEE(aQute.bnd.osgi.Processor run)
      Set -runee from the build environment if not already set in the Processor object.
      Parameters:
      run - The Processor object.
    • inferRunRequires

      protected void inferRunRequires(aQute.bnd.osgi.Processor run)
      Set -runrequires from the build environment if not already set in the Processor object.
      Parameters:
      run - The Processor object.