Package org.gradle.plugins.signing
Class Sign
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.plugins.signing.Sign
- All Implemented Interfaces:
Comparable<Task>
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.TaskInternal
,ExtensionAware
,Task
,SignatureSpec
,org.gradle.util.Configurable<Task>
A task for creating digital signature files for one or more; tasks, files, publishable artifacts or configurations.
The task produces Signature
The signature objects are created with defaults and using this tasks signatory and signature type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer
-
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
generate()
Generates the signature files.protected org.gradle.api.internal.file.FileCollectionFactory
All of the files that will be signed by this task.Returns the signatory for this signing task.All of the signature files that will be generated by this operation.The signatures generated by this task.The signature representation that will be created.Returns the single signature generated by this task.boolean
Whether or not this task should fail if no signatory or signature type are configured at generation time.void
required
(boolean required) Change whether or not this task should fail if no signatory or signature type are configured at the time of generation.void
setRequired
(boolean required) Whether or not it is required that this signature be generated.void
setSignatory
(Signatory signatory) Sets the signatory that will be signing the input.void
setSignatureType
(SignatureType signatureType) Sets the signature representation that the signatures will be produced as.void
Configures the task to sign each of the given filesvoid
Configures the task to sign each of the given artifacts, using the given classifier as the classifier for the resultant signature publish artifact.void
sign
(Configuration... configurations) Configures the task to sign every artifact of the given configurationsvoid
sign
(PublishArtifact... publishArtifacts) Configures the task to sign each of the given artifactsvoid
Configures the task to sign the archive produced for each of the given tasks (which must be archive tasks).void
Changes the signatory of the signatures.Methods inherited from class org.gradle.api.DefaultTask
newInputDirectory, newInputFile, newOutputDirectory, newOutputFile
Methods inherited from class org.gradle.api.internal.AbstractTask
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doFirst, doLast, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString
-
Constructor Details
-
Sign
public Sign()
-
-
Method Details
-
getInputFiles
-
getOutputFiles
-
sign
Configures the task to sign the archive produced for each of the given tasks (which must be archive tasks). -
sign
Configures the task to sign each of the given artifacts -
sign
Configures the task to sign each of the given files -
sign
Configures the task to sign each of the given artifacts, using the given classifier as the classifier for the resultant signature publish artifact. -
sign
Configures the task to sign every artifact of the given configurations -
signatory
Changes the signatory of the signatures. -
required
public void required(boolean required) Change whether or not this task should fail if no signatory or signature type are configured at the time of generation. -
generate
public void generate()Generates the signature files. -
getSignatures
The signatures generated by this task. -
getSingleSignature
Returns the single signature generated by this task.- Returns:
- The signature.
- Throws:
IllegalStateException
- if there is not exactly one signature.
-
getFileCollectionFactory
@Inject protected org.gradle.api.internal.file.FileCollectionFactory getFileCollectionFactory() -
getFilesToSign
All of the files that will be signed by this task. -
getSignatureFiles
All of the signature files that will be generated by this operation. -
getSignatureType
Description copied from interface:SignatureSpec
The signature representation that will be created.- Specified by:
getSignatureType
in interfaceSignatureSpec
- Returns:
- the signature type, or
null
if none specified.
-
setSignatureType
Description copied from interface:SignatureSpec
Sets the signature representation that the signatures will be produced as.- Specified by:
setSignatureType
in interfaceSignatureSpec
- Parameters:
signatureType
- the signature type to use
-
getSignatory
Returns the signatory for this signing task.- Specified by:
getSignatory
in interfaceSignatureSpec
- Returns:
- the signatory
-
setSignatory
Description copied from interface:SignatureSpec
Sets the signatory that will be signing the input.- Specified by:
setSignatory
in interfaceSignatureSpec
- Parameters:
signatory
- The signatory
-
isRequired
Whether or not this task should fail if no signatory or signature type are configured at generation time.Defaults to
true
.- Specified by:
isRequired
in interfaceSignatureSpec
- Returns:
- Whether or not it is required that this signature be generated.
-
setRequired
public void setRequired(boolean required) Description copied from interface:SignatureSpec
Whether or not it is required that this signature be generated.- Specified by:
setRequired
in interfaceSignatureSpec
- Parameters:
required
- Whether or not it is required that this signature be generated.- See Also:
-