Class Resolve

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
aQute.bnd.gradle.AbstractBndrun
aQute.bnd.gradle.Resolve
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 Resolve extends AbstractBndrun
Resolve task type for Gradle.

This task type can be used to resolve a bndrun file setting the `-runbundles` instruction.

Here is an example of using the Resolve task type:

 import aQute.bnd.gradle.Resolve
 def resolveTask = tasks.register("resolve", Resolve) {
   bndrun = file("my.bndrun")
   outputBndrun = layout.buildDirectory.file("my.bndrun")
 }
 

Properties:

  • bndrun - This is the bndrun file to be resolved. 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 resolve process. 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.
  • failOnChanges - If true the task will fail if the resolve process results in a different value for -runbundles than the current value. The default is false.
  • outputBndrun - This is the output file for the calculated -runbundles property. The default is the input bndrun file which means the input bndrun file will be updated in place.
  • reportOptional - If true failure reports will include optional requirements. The default is true.
  • writeOnChanges - If true the task will write changes to the value of the -runbundles property. The default is true.
  • 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 Resolve task.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected biz.aQute.resolve.Bndrun
    createBndrun(aQute.bnd.build.Workspace workspace, File bndrunFile)
    Create the Bndrun object.
    boolean
    Whether resolve changes should fail the task.
    org.gradle.api.file.RegularFileProperty
    Return the output file for the calculated -runbundles property.
    boolean
    Whether to report optional requirements.
    boolean
    Whether resolve changes should be written.
    boolean
    Whether resolve changes should fail the task.
    boolean
    Whether to report optional requirements.
    boolean
    Whether resolve changes should be written.
    void
    setFailOnChanges(boolean failOnChanges)
    Set whether resolve changes should fail the task.
    void
    setReportOptional(boolean reportOptional)
    Set whether to report optional requirements.
    void
    setWriteOnChanges(boolean writeOnChanges)
    Set whether resolve changes should be written.
    protected void
    worker(aQute.bnd.build.Project run)
    Resolve the Bndrun 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

    • Resolve

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

    • isFailOnChanges

      @Input public boolean isFailOnChanges()
      Whether resolve changes should fail the task.
      Returns:
      true if a change to the current -runbundles value will fail the task. The default is false.
    • getFailOnChanges

      @Internal public boolean getFailOnChanges()
      Whether resolve changes should fail the task.

      Alias for isFailOnChanges().

      Returns:
      true if a change to the current -runbundles value will fail the task. The default is false.
    • setFailOnChanges

      public void setFailOnChanges(boolean failOnChanges)
      Set whether resolve changes should fail the task.
      Parameters:
      failOnChanges - If true, then a change to the current -runbundles value will fail the task. The default is false.
    • getOutputBndrun

      @OutputFile public org.gradle.api.file.RegularFileProperty getOutputBndrun()
      Return the output file for the calculated -runbundles property.

      By default, the input bndrun file is used as the output bndrun file. That is, the input bndrun file will be updated in place. If this property is set to a value other than the input bndrun file, the output bndrun file will -include the input bndrun file and can be thus be used by other tasks, such as TestOSGi as a resolved input bndrun file.

      Returns:
      The output file for the calculated -runbundles property.
    • isReportOptional

      @Input public boolean isReportOptional()
      Whether to report optional requirements.
      Returns:
      true if optional requirements will be reported. The default is false.
    • getReportOptional

      @Internal public boolean getReportOptional()
      Whether to report optional requirements.

      Alias for isReportOptional().

      Returns:
      true if optional requirements will be reported. The default is false.
    • setReportOptional

      public void setReportOptional(boolean reportOptional)
      Set whether to report optional requirements.
      Parameters:
      reportOptional - If true, then optional requirements will be reported. The default is false.
    • isWriteOnChanges

      @Input public boolean isWriteOnChanges()
      Whether resolve changes should be written.
      Returns:
      true if a change to the current -runbundles value will be written to the output bndrun file. The default is false.
    • getWriteOnChanges

      @Internal public boolean getWriteOnChanges()
      Whether resolve changes should be written.

      Alias for isWriteOnChanges().

      Returns:
      true if a change to the current -runbundles value will be written to the output bndrun file. The default is false.
    • setWriteOnChanges

      public void setWriteOnChanges(boolean writeOnChanges)
      Set whether resolve changes should be written.
      Parameters:
      writeOnChanges - If true, then a change to the current -runbundles value will be written to the output bndrun file. The default is false.
    • createBndrun

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

      protected void worker(aQute.bnd.build.Project run) throws Exception
      Resolve the Bndrun object.
      Specified by:
      worker in class AbstractBndrun
      Parameters:
      run - The Bndrun object.
      Throws:
      Exception - If the worker action has an exception or the input is not a Bndrun object.