SignatureSpec
public class SignOperation extends Object implements SignatureSpec
publish artifacts
.
The external representation of the signature is specified by the signature type property
, while the signatory
property specifies who is to sign.
A sign
operation manages one or more Signature
objects. The sign
methods are used to register things to generate signatures for. The execute()
method generates the signatures for
all of the registered items at that time.
Constructor | Description |
---|---|
SignOperation() |
Modifier and Type | Method | Description |
---|---|---|
SignOperation |
configure(Closure closure) |
Executes the given closure against this object.
|
SignOperation |
execute() |
Generates actual signature files for all of the registered signatures.
|
String |
getDisplayName() |
|
FileCollection |
getFilesToSign() |
All of the files that will be signed by this operation.
|
Signatory |
getSignatory() |
The signatory that will be performing the signing.
|
FileCollection |
getSignatureFiles() |
All of the signature files that will be generated by this operation.
|
List<Signature> |
getSignatures() |
The registered signatures.
|
SignatureType |
getSignatureType() |
The signature representation that will be created.
|
Signature |
getSingleSignature() |
Returns the single registered signature.
|
boolean |
isRequired() |
Whether or not it is required that this signature be generated.
|
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.
|
SignOperation |
sign(File... files) |
Registers signatures for the given files.
|
SignOperation |
sign(String classifier,
File... files) |
Registers signatures (with the given classifier) for the given files
|
SignOperation |
sign(PublishArtifact... artifacts) |
Registers signatures for the given artifacts.
|
SignOperation |
signatory(Signatory signatory) |
Change the signatory for signature generation.
|
SignOperation |
signatureType(SignatureType type) |
Change the signature type for signature generation.
|
String |
toString() |
public String getDisplayName()
public void setSignatureType(SignatureType signatureType)
SignatureSpec
setSignatureType
in interface SignatureSpec
signatureType
- the signature type to usepublic SignatureType getSignatureType()
SignatureSpec
getSignatureType
in interface SignatureSpec
null
if none specified.public void setSignatory(Signatory signatory)
SignatureSpec
setSignatory
in interface SignatureSpec
signatory
- The signatorypublic Signatory getSignatory()
SignatureSpec
getSignatory
in interface SignatureSpec
null
if none specified.public void setRequired(boolean required)
SignatureSpec
setRequired
in interface SignatureSpec
required
- Whether or not it is required that this signature be generated.SignatureSpec.isRequired()
public boolean isRequired()
SignatureSpec
isRequired
in interface SignatureSpec
public SignOperation sign(PublishArtifact... artifacts)
Signature(File, SignatureSpec, Object...)
public SignOperation sign(File... files)
Signature(File, SignatureSpec, Object...)
public SignOperation sign(String classifier, File... files)
Signature(PublishArtifact, SignatureSpec, Object...)
public SignOperation signatureType(SignatureType type)
public SignOperation signatory(Signatory signatory)
public SignOperation configure(Closure closure)
public SignOperation execute()
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.
Signature.generate()
public Signature getSingleSignature()
IllegalStateException
- if there is not exactly one registered signature.public FileCollection getFilesToSign()
public FileCollection getSignatureFiles()