Package: org.gradle.plugins.signing

## [Groovy] Class Sign

- org.gradle.plugins.signing.Sign

- All Implemented Interfaces and Traits:
    SignatureSpec

      class Sign
      extends DefaultTask

  A task for creating digital signature files for one or more; tasks, files, publishable artifacts or configurations.

  The task produces Signature

  objects that are publishable artifacts and can be assigned to another configuration.

  The signature objects are created with defaults and using this tasks signatory and signature type.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `boolean` | `required` Whether or not this task should fail if no signatory or signature type are configured at generation time.
    `Signatory` | `signatory` The signatory to the generated signatures.
    `SignatureType` | `signatureType`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Sign ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `generate()` Generates the signature files.
    `FileCollection` | `getFilesToSign()` All of the files that will be signed by this task.
    `FileCollection` | `getSignatureFiles()` All of the signature files that will be generated by this operation.
    `DomainObjectSet<Signature>` | `getSignatures()` The signatures generated by this task.
    `Signature` | `getSingleSignature()` Returns the the single signature generated by this task.
    `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` | `sign(Task... tasks)` Configures the task to sign the archive produced for each of the given tasks (which must be archive tasks).
    `void` | `sign(PublishArtifact... publishArtifacts)` Configures the task to sign each of the given artifacts
    `void` | `sign(File... files)` Configures the task to sign each of the given files
    `void` | `sign(String classifier, File... files)` 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 configurations
    `void` | `signatory(Signatory signatory)` Changes the signatory of the signatures.
    `void` | `signatureType(SignatureType type)` Changes the signature file representation for the signatures.

- - ### Property Detail

    - #### boolean required

      Whether or not this task should fail if no signatory or signature type are configured at generation time.

      Defaults to `true`.

    - #### Signatory signatory

      The signatory to the generated signatures.

    - #### SignatureType signatureType

  - ### Constructor Detail

    - #### Sign()

  - ### Method Detail

    - #### @TaskAction void generate()

      Generates the signature files.

    - #### FileCollection getFilesToSign()

      All of the files that will be signed by this task.

    - #### FileCollection getSignatureFiles()

      All of the signature files that will be generated by this operation.

    - #### DomainObjectSet<Signature> getSignatures()

      The signatures generated by this task.

    - #### Signature getSingleSignature()

      Returns the the single signature generated by this task.

      throws:
        IllegalStateException if there is not exactly one signature.
      Returns:
        The signature.

    - #### 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 sign(Task... tasks)

      Configures the task to sign the archive produced for each of the given tasks (which must be archive tasks).

    - #### void sign(PublishArtifact... publishArtifacts)

      Configures the task to sign each of the given artifacts

    - #### void sign(File... files)

      Configures the task to sign each of the given files

    - #### void sign(String classifier, File... files)

      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 configurations

    - #### void signatory(Signatory signatory)

      Changes the signatory of the signatures.

    - #### void signatureType(SignatureType type)

      Changes the signature file representation for the signatures.