# sign

open fun sign(tasks: Array<Task>): List<Sign>

Creates signing tasks that depend on and sign the "archive" produced by the given tasks.

The created tasks will be named "sign<input task name capitalized>". That is, given a task with the name "jar" the created task will be named "signJar".

If the task is not an org.gradle.api.tasks.bundling.AbstractArchiveTask, an InvalidUserDataException will be thrown.

The signature artifact for the created task is added to the for this settings object.

#### Return

the created tasks.

#### Parameters

tasks

The tasks whose archives are to be signed

open fun sign(configurations: Array<Configuration>): List<Sign>

Creates signing tasks that sign all artifacts of the given configurations.

The created tasks will be named "sign<configuration name capitalized>". That is, given a configuration with the name "conf" the created task will be named "signConf". The signature artifacts for the created tasks are added to the configuration for this settings object.

#### Return

the created tasks.

#### Parameters

configurations

The configurations whose archives are to be signed

open fun sign(publications: Array<Publication>): List<Sign>

Creates signing tasks that sign all publishable artifacts of the given publications.

The created tasks will be named "sign<publication name capitalized>Publication". That is, given a publication with the name "mavenJava" the created task will be named "signMavenJavaPublication". The signature artifacts for the created tasks are added to the publishable artifacts of the given publications.

#### Return

the created tasks.

#### Since

4.8

#### Parameters

publications

The publications whose artifacts are to be signed

open fun sign(publications: DomainObjectCollection<Publication>): List<Sign>

Creates signing tasks that sign all publishable artifacts of the given publication collection.

The created tasks will be named "sign<publication name capitalized>Publication". That is, given a publication with the name "mavenJava" the created task will be named "signMavenJavaPublication". The signature artifacts for the created tasks are added to the publishable artifacts of the given publications.

#### Return

the created tasks.

#### Since

4.8

#### Parameters

publications

The collection of publications whose artifacts are to be signed

open fun sign(publishArtifacts: Array<PublishArtifact>): SignOperation

Digitally signs the publish artifacts, generating signature files alongside them.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available, the sign operation will fail.

#### Return

The executed sign operation

#### Parameters

publishArtifacts

The publish artifacts to sign

open fun sign(files: Array<File>): SignOperation

Digitally signs the files, generating signature files alongside them.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available, the sign operation will fail.

#### Return

The executed sign operation.

#### Parameters

files

The files to sign.

open fun sign(classifier: String, files: Array<File>): SignOperation

Digitally signs the files, generating signature files alongside them.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available, the sign operation will fail.

#### Return

The executed sign operation.

#### Parameters

classifier

The classifier to assign to the created signature artifacts.

files

The publish artifacts to sign.

open fun sign(@DelegatesTo(value = SignOperation::class) closure: Closure<out Any>): SignOperation

Creates a new sign operation using the given closure to configure it before executing it.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available (and one is not explicitly specified in this operation's configuration), the sign operation will fail.

#### Return

The executed sign operation.

#### Parameters

closure

The configuration of the sign operation.

@Incubating
open fun sign(setup: Action<SignOperation>): SignOperation

Creates a new sign operation using the given action to configure it before executing it.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available (and one is not explicitly specified in this operation's configuration), the sign operation will fail.

#### Return

The executed sign operation.

#### Since

7.5

#### Parameters

setup

The configuration action of the sign operation.