Class SignOperation
java.lang.Object
org.gradle.plugins.signing.SignOperation
- All Implemented Interfaces:
SignatureSpec
A sign operation creates digital signatures for one or more files.
The external representation of the signature is specified by getSignatureType(), while the
getSignatory() specifies how to sign. The sign methods are used to register files to
generate signatures for. The execute() method generates the signatures for all the registered
items at that time.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecutes the given closure against this object.execute()Generates actual signature files for all of the registered signatures.Returns the display name.All of the files that will be signed by this operation.The signatory that will be performing the signing.All of the signature files that will be generated by this operation.Deprecated.This method will be removed in Gradle 10.The signature representation that will be created.Deprecated.This method will be removed in Gradle 10.booleanWhether or not it is required that this signature be generated.voidsetRequired(boolean required) Whether or not it is required that this signature be generated.voidsetSignatory(Signatory signatory) Sets the signatory that will be signing the input.voidsetSignatureType(SignatureType signatureType) Sets the signature representation that the signatures will be produced as.Registers signatures for the given files.Deprecated.This method will be removed in Gradle 10.sign(PublishArtifact... artifacts) Registers signatures for the given artifacts.Change the signatory for signature generation.signatureType(SignatureType type) Change the signature type for signature generation.protected abstract FileCollectiontoFileCollection(List<File> files) To file collection.toString()
-
Constructor Details
-
SignOperation
public SignOperation()
-
-
Method Details
-
getDisplayName
-
toString
-
setSignatureType
Description copied from interface:SignatureSpecSets the signature representation that the signatures will be produced as.- Specified by:
setSignatureTypein interfaceSignatureSpec- Parameters:
signatureType- the signature type to use
-
getSignatureType
Description copied from interface:SignatureSpecThe signature representation that will be created.- Specified by:
getSignatureTypein interfaceSignatureSpec- Returns:
- the signature type, or
nullif none specified.
-
setSignatory
Description copied from interface:SignatureSpecSets the signatory that will be signing the input.- Specified by:
setSignatoryin interfaceSignatureSpec- Parameters:
signatory- The signatory
-
getSignatory
Description copied from interface:SignatureSpecThe signatory that will be performing the signing.- Specified by:
getSignatoryin interfaceSignatureSpec- Returns:
- the signatory, or
nullif none specified.
-
setRequired
public void setRequired(boolean required) Description copied from interface:SignatureSpecWhether or not it is required that this signature be generated.- Specified by:
setRequiredin interfaceSignatureSpec- Parameters:
required- Whether or not it is required that this signature be generated.- See Also:
-
isRequired
public boolean isRequired()Description copied from interface:SignatureSpecWhether or not it is required that this signature be generated. A signature may not be able to be generated if a signatory and/or a signature type have not been specified. If it is required and cannot be generated, an exception will be thrown. Otherwise, it will not be generated.- Specified by:
isRequiredin interfaceSignatureSpec- Returns:
- Whether or not it is required that this signature be generated.
-
sign
Registers signatures for the given artifacts.- Returns:
- this
- Since:
- 1.0
-
sign
Registers signatures for the given files.- Returns:
- this
- Since:
- 1.0
-
sign
Deprecated.This method will be removed in Gradle 10. Usesign(File...)instead.Registers signatures (with the given classifier) for the given files- Returns:
- this
- Since:
- 1.0
-
signatureType
Change the signature type for signature generation.- Since:
- 1.0
-
signatory
Change the signatory for signature generation.- Since:
- 1.0
-
configure
Executes the given closure against this object.- Since:
- 1.0
-
execute
Generates actual signature files for all of the registered signatures.The signatures are generated with the configuration they have at this time, which includes the signature type and signatory of this operation at this time.
This method can be called multiple times, with the signatures being generated with their current configuration each time.
- Returns:
- this
- Since:
- 1.0
-
getSignatures
Deprecated.This method will be removed in Gradle 10. UsegetFilesToSign()orgetSignatureFiles()instead.The registered signatures.- Since:
- 1.0
-
getSingleSignature
Deprecated.This method will be removed in Gradle 10. UsegetFilesToSign()orgetSignatureFiles()instead.Returns the single registered signature.- Returns:
- The signature.
- Throws:
IllegalStateException- if there is not exactly one registered signature.- Since:
- 1.0
-
getFilesToSign
All of the files that will be signed by this operation.- Since:
- 1.0
-
getSignatureFiles
All of the signature files that will be generated by this operation.- Since:
- 1.0
-
toFileCollection
-