Package aQute.bnd.gradle
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>
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected biz.aQute.resolve.BndruncreateBndrun(aQute.bnd.build.Workspace workspace, File bndrunFile) Create the Bndrun object.booleanWhether resolve changes should fail the task.org.gradle.api.file.RegularFilePropertyReturn the output file for the calculated-runbundlesproperty.booleanWhether to report optional requirements.booleanWhether resolve changes should be written.booleanWhether resolve changes should fail the task.booleanWhether to report optional requirements.booleanWhether resolve changes should be written.voidsetFailOnChanges(boolean failOnChanges) Set whether resolve changes should fail the task.voidsetReportOptional(boolean reportOptional) Set whether to report optional requirements.voidsetWriteOnChanges(boolean writeOnChanges) Set whether resolve changes should be written.protected voidworker(aQute.bnd.build.Project run) Resolve the Bndrun object.Methods inherited from class aQute.bnd.gradle.AbstractBndrun
bndrunAction, bundles, getBndrun, getBundles, getIgnoreFailures, getProperties, getWorkingDirectory, inferRunEE, inferRunRequires, isIgnoreFailures, setBundles, setIgnoreFailuresMethods 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, usesServiceMethods 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, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
trueif a change to the current-runbundlesvalue will fail the task. The default isfalse.
-
getFailOnChanges
@Internal public boolean getFailOnChanges()Whether resolve changes should fail the task.Alias for
isFailOnChanges().- Returns:
trueif a change to the current-runbundlesvalue will fail the task. The default isfalse.
-
setFailOnChanges
public void setFailOnChanges(boolean failOnChanges) Set whether resolve changes should fail the task.- Parameters:
failOnChanges- Iftrue, then a change to the current-runbundlesvalue will fail the task. The default isfalse.
-
getOutputBndrun
@OutputFile public org.gradle.api.file.RegularFileProperty getOutputBndrun()Return the output file for the calculated-runbundlesproperty.By default, the input
bndrunfile 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-includethe 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
-runbundlesproperty.
-
isReportOptional
@Input public boolean isReportOptional()Whether to report optional requirements.- Returns:
trueif optional requirements will be reported. The default isfalse.
-
getReportOptional
@Internal public boolean getReportOptional()Whether to report optional requirements.Alias for
isReportOptional().- Returns:
trueif optional requirements will be reported. The default isfalse.
-
setReportOptional
public void setReportOptional(boolean reportOptional) Set whether to report optional requirements.- Parameters:
reportOptional- Iftrue, then optional requirements will be reported. The default isfalse.
-
isWriteOnChanges
@Input public boolean isWriteOnChanges()Whether resolve changes should be written.- Returns:
trueif a change to the current-runbundlesvalue will be written to the output bndrun file. The default isfalse.
-
getWriteOnChanges
@Internal public boolean getWriteOnChanges()Whether resolve changes should be written.Alias for
isWriteOnChanges().- Returns:
trueif a change to the current-runbundlesvalue will be written to the output bndrun file. The default isfalse.
-
setWriteOnChanges
public void setWriteOnChanges(boolean writeOnChanges) Set whether resolve changes should be written.- Parameters:
writeOnChanges- Iftrue, then a change to the current-runbundlesvalue will be written to the output bndrun file. The default isfalse.
-
createBndrun
protected biz.aQute.resolve.Bndrun createBndrun(aQute.bnd.build.Workspace workspace, File bndrunFile) throws Exception Create the Bndrun object.- Overrides:
createBndrunin classAbstractBndrun- 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
Resolve the Bndrun object.- Specified by:
workerin classAbstractBndrun- Parameters:
run- The Bndrun object.- Throws:
Exception- If the worker action has an exception or the input is not a Bndrun object.
-