Class Signature
- All Implemented Interfaces:
- PublishArtifact,- Buildable,- org.gradle.api.internal.artifacts.PublishArtifactInternal
A signature file is always generated from another file, which may be a PublishArtifact.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classConfiguration-cache compatible signature generator.
- 
Constructor SummaryConstructorsConstructorDescriptionSignature(Closure<File> toSign, Closure<String> classifier, SignatureSpec signatureSpec, Object... tasks) Creates a signature artifact for the file returned by thetoSignclosure.Signature(File toSign, String classifier, SignatureSpec signatureSpec, Object... tasks) Creates a signature artifact for the given file, with the given classifier.Signature(File toSign, SignatureSpec signatureSpec, Object... tasks) Creates a signature artifact for the given file.Signature(Callable<File> toSign, Callable<String> classifier, SignatureSpec signatureSpec, Object... tasks) Creates a signature artifact for the file returned by thetoSignclosure.Signature(PublishArtifact toSign, SignatureSpec signatureSpec, Object... tasks) Creates a signature artifact for the given public artifact.
- 
Method SummaryModifier and TypeMethodDescriptionvoidgenerate()Generates the signature file.Returns a dependency which contains the tasks which build this artifact.The classifier of the signature artifact.getDate()The date of the signature artifact.The extension of the signature artifact.getFile()The file for the generated signature, which may not yet exist.getName()The name of the signature artifact.The signatory of this signature file.The file representation type of the signature.The file that is to be signed.getType()The type of the signature artifact.voidsetClassifier(String classifier) voidvoidsetExtension(String extension) voidvoidsetSignatureSpec(SignatureSpec signatureSpec) voidbooleanMethods inherited from class org.gradle.api.internal.artifacts.publish.AbstractPublishArtifactbuiltBy, toString
- 
Constructor Details- 
SignatureCreates a signature artifact for the given public artifact.The file to sign will be the file of the given artifact and the classifier of this signature artifact will default to the classifier of the given artifact to sign. The artifact to sign may change after being used as the source for this signature. - Parameters:
- toSign- The artifact that is to be signed
- signatureSpec- The specification of how the artifact is to be signed
- tasks- The task(s) that will invoke- generate()on this signature (optional)
 
- 
SignatureCreates a signature artifact for the given file.- Parameters:
- toSign- The file that is to be signed
- signatureSpec- The specification of how the artifact is to be signed
- tasks- The task(s) that will invoke- generate()on this signature (optional)
 
- 
SignatureCreates a signature artifact for the given file, with the given classifier.- Parameters:
- toSign- The file that is to be signed
- classifier- The classifier to assign to the signature (should match the files)
- signatureSpec- The specification of how the artifact is to be signed
- tasks- The task(s) that will invoke- generate()on this signature (optional)
 
- 
Signaturepublic Signature(Closure<File> toSign, Closure<String> classifier, SignatureSpec signatureSpec, Object... tasks) Creates a signature artifact for the file returned by thetoSignclosure.The closures will be "evaluated" on demand whenever the value is needed (e.g. at generation time) - Parameters:
- toSign- A closure that produces a File for the object to sign (non File return values will be used as the path to the file)
- classifier- A closure that produces the classifier to assign to the signature artifact on demand
- signatureSpec- The specification of how the artifact is to be signed
- tasks- The task(s) that will invoke- generate()on this signature (optional)
 
- 
Signaturepublic Signature(Callable<File> toSign, Callable<String> classifier, SignatureSpec signatureSpec, Object... tasks) Creates a signature artifact for the file returned by thetoSignclosure.The closures will be "evaluated" on demand whenever the value is needed (e.g. at generation time) - Parameters:
- toSign- A closure that produces a File for the object to sign (non File return values will be used as the path to the file)
- classifier- A closure that produces the classifier to assign to the signature artifact on demand
- signatureSpec- The specification of how the artifact is to be signed
- tasks- The task(s) that will invoke- generate()on this signature (optional)
 
 
- 
- 
Method Details- 
getToSignThe file that is to be signed.- Returns:
- The file. May be nullif unknown at this time.
 
- 
setName
- 
getNameThe name of the signature artifact.Defaults to the name of the signature file.- Returns:
- The name. May be nullif unknown at this time. FIXME Nullability consistency with superclass.
 
- 
setExtension
- 
getExtensionThe extension of the signature artifact.Defaults to the specified file extension of the signature type.- Returns:
- The extension. May be nullif unknown at this time. FIXME Nullability consistency with superclass.
 
- 
setType
- 
getTypeThe type of the signature artifact.Defaults to the extension of the file to signplus the extension of thesignature type. For example, when signing the file ‘my.zip’ with a signature type with extension ‘sig’, the default type is ‘zip.sig’.- Returns:
- The type. May be nullif the file to sign or signature type are unknown at this time. FIXME Nullability consistency with superclass.
 
- 
setClassifier
- 
getClassifierThe classifier of the signature artifact.Defaults to the classifier of the source artifact (if signing an artifact) or the given classifier at construction (if given). - Returns:
- The classifier. May be nullif unknown at this time.
 
- 
setDate
- 
getDateThe date of the signature artifact.Defaults to the last modified time of the signature file(if exists)- Returns:
- The date of the signature. May be nullif unknown at this time.
 
- 
getFileThe file for the generated signature, which may not yet exist.The file will be placed alongside the file to signwith the extension of thesignature type.- Returns:
- The signature file. May be nullif unknown at this time.
- See Also:
 
- 
getSignatoryThe signatory of this signature file.- Returns:
- The signatory. May be nullif unknown at this time.
 
- 
getSignatureTypeThe file representation type of the signature.- Returns:
- The signature type. May be nullif unknown at this time.
 
- 
setSignatureSpec
- 
getSignatureSpec
- 
getBuildDependenciesDescription copied from interface:BuildableReturns a dependency which contains the tasks which build this artifact. AllBuildableimplementations must ensure that the returned dependency object is live, so that it tracks changes to the dependencies of this buildable.- Specified by:
- getBuildDependenciesin interface- Buildable
- Overrides:
- getBuildDependenciesin class- org.gradle.api.internal.artifacts.publish.AbstractPublishArtifact
- Returns:
- The dependency. Never returns null. Returns an empty dependency when this artifact is not built by any tasks.
 
- 
shouldBePublishedpublic boolean shouldBePublished()
- 
generatepublic void generate()Generates the signature file.In order to generate the signature, the file to sign,signatoryandsignature typemust be known (i.e. nonnull).- Throws:
- InvalidUserDataException- if the there is insufficient information available to generate the signature.
 
 
-