Class SigningExtension
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.This constant will be removed in Gradle 10. -
Constructor Summary
ConstructorsConstructorDescriptionSigningExtension(Project project) Configures the signing settings for the given project. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.This method will be removed in Gradle 10.protected ObjectaddSignaturesToConfiguration(Sign task, Configuration configuration) Deprecated.This method will be removed in Gradle 10.protected SignatoryProvider<?> Provides the signatory provider.protected SignatureTypeProviderProvides the signature type provider.protected SignOperationdoSignOperation(Closure<?> setup) Deprecated.This method will be removed in Gradle 10.protected SignOperationdoSignOperation(Action<SignOperation> setup) Deprecated.This method will be removed in Gradle 10.Deprecated.This method will be removed in Gradle 10.protected ConfigurationDeprecated.This method will be removed in Gradle 10.final ProjectReturns the project.Returns the signatories.The signatory that will be used for signing when an explicit signatory has not been specified.The signature type that will be used for signing files when an explicit signature type has not been specified.Returns the signature types.booleanWhether this task should fail if no signatory or signature type are configured at generation time.voidsetConfiguration(Configuration configuration) Deprecated.This method will be removed in Gradle 10.voidsetRequired(boolean required) Whether this task should fail if no signatory or signature type are configured at generation time.voidsetRequired(Object required) Whether this task should fail if no signatory or signature type are configured at generation time.voidsetSignatories(SignatoryProvider<?> signatories) Sets the signatories.voidsetSignatureTypes(SignatureTypeProvider signatureTypes) Sets the signature types.Creates a newsign operationusing the given closure to configure it before executing it.Digitally signs the files, generating signature files alongside them.Deprecated.This method will be removed in Gradle 10.sign(Action<SignOperation> setup) Creates a newsign operationusing the given action to configure it before executing it.sign(Configuration... configurations) Creates signing tasks that signall artifactsof the given configurations.sign(PublishArtifact... publishArtifacts) Digitally signs the publish artifacts, generating signature files alongside them.sign(DomainObjectCollection<Publication> publications) Creates signing tasks that sign all publishable artifacts of the given publication collection.sign(Publication... publications) Creates signing tasks that sign all publishable artifacts of the given publications.Creates signing tasks that depend on and sign the "archive" produced by the given tasks.signatories(Closure<?> closure) Configures the signatory provider (delegating to itsconfigure method).voidsignatories(Action<? super SignatoryProvider<?>> action) Configures the signatory provider with the given action.voidUse GnuPG agent to perform signing work.voiduseInMemoryPgpKeys(@Nullable String defaultSecretKey, @Nullable String defaultPassword) Use the supplied ascii-armored in-memory PGP secret key and password instead of reading it from a keyring.voiduseInMemoryPgpKeys(@Nullable String defaultKeyId, @Nullable String defaultSecretKey, @Nullable String defaultPassword) Use the supplied ascii-armored in-memory PGP secret key and password instead of reading it from a keyring.
-
Field Details
-
DEFAULT_CONFIGURATION_NAME
Deprecated.This constant will be removed in Gradle 10.The name of the configuration that all signature artifacts will be placed into ("signatures")- Since:
- 2.14
- See Also:
-
-
Constructor Details
-
SigningExtension
Configures the signing settings for the given project.- Since:
- 1.0
-
-
Method Details
-
getProject
-
setRequired
public void setRequired(boolean required) Whether this task should fail if no signatory or signature type are configured at generation time.- Since:
- 4.0
-
setRequired
Whether this task should fail if no signatory or signature type are configured at generation time. Ifrequiredis aCallable, it will be stored and "called" on demand (i.e. whenisRequired()is called) and the return value will be interpreting according to the Groovy Truth. For example:signing { required = { gradle.taskGraph.hasTask("publish") } }Because the task graph is not known until Gradle starts executing, we must use defer the decision. We can do this via using aClosure(which is aCallable). For any other type, the value will be stored and evaluated on demand according to the Groovy Truth.signing { required = false }- Since:
- 1.0
-
isRequired
public boolean isRequired()Whether this task should fail if no signatory or signature type are configured at generation time.Defaults to
true.- Since:
- 1.0
- See Also:
-
getDefaultConfiguration
Deprecated.This method will be removed in Gradle 10.Provides the configuration that signature artifacts are added to.- Since:
- 1.0
-
createSignatureTypeProvider
Provides the signature type provider. Called once during construction.- Since:
- 1.0
-
createSignatoryProvider
Provides the signatory provider. Called once during construction.- Since:
- 1.0
-
signatories
Configures the signatory provider (delegating to itsconfigure method).- Parameters:
closure- the signatory provider configuration DSL- Returns:
- the configured signatory provider
- Since:
- 1.0
-
signatories
Configures the signatory provider with the given action.- Parameters:
action- the configuration action- Since:
- 9.3.0
-
getSignatory
The signatory that will be used for signing when an explicit signatory has not been specified.Delegates to the signatory provider's default signatory.
- Since:
- 1.0
-
getSignatureType
The signature type that will be used for signing files when an explicit signature type has not been specified.Delegates to the signature type provider's default type.
- Since:
- 1.0
-
setSignatureTypes
Sets the signature types.- Since:
- 1.0
-
getSignatureTypes
-
setSignatories
-
setConfiguration
Deprecated.This method will be removed in Gradle 10.Set the configuration to add signatures to.- Since:
- 1.0
-
useGpgCmd
public void useGpgCmd()Use GnuPG agent to perform signing work.- Since:
- 4.5
-
useInMemoryPgpKeys
Use the supplied ascii-armored in-memory PGP secret key and password instead of reading it from a keyring.signing { def secretKey = findProperty("mySigningKey") def password = findProperty("mySigningPassword") useInMemoryPgpKeys(secretKey, password) }- Since:
- 5.4
-
useInMemoryPgpKeys
public void useInMemoryPgpKeys(@Nullable String defaultKeyId, @Nullable String defaultSecretKey, @Nullable String defaultPassword) Use the supplied ascii-armored in-memory PGP secret key and password instead of reading it from a keyring. In case a signing subkey is provided, keyId must be provided as well.signing { def keyId = findProperty("keyId") def secretKey = findProperty("mySigningKey") def password = findProperty("mySigningPassword") useInMemoryPgpKeys(keyId, secretKey, password) }- Since:
- 6.0
-
getConfiguration
Deprecated.This method will be removed in Gradle 10.The configuration that signature artifacts are added to.- Since:
- 1.0
-
addSignatureSpecConventions
Deprecated.This method will be removed in Gradle 10.Adds conventions to the given spec, using this settings object's default signatory and signature type as the default signatory and signature type for the spec.- Since:
- 1.0
-
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
AbstractArchiveTask, anInvalidUserDataExceptionwill be thrown.The signature artifact for the created task is added to the
for this settings object.- Parameters:
tasks- The tasks whose archives are to be signed- Returns:
- the created tasks.
- Since:
- 1.0
-
sign
Creates signing tasks that signall artifactsof 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
configurationfor this settings object.- Parameters:
configurations- The configurations whose archives are to be signed- Returns:
- the created tasks.
- Since:
- 1.0
-
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.
- Parameters:
publications- The publications whose artifacts are to be signed- Returns:
- the created tasks.
- Since:
- 4.8
-
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.
- Parameters:
publications- The collection of publications whose artifacts are to be signed- Returns:
- the created tasks.
- Since:
- 4.8
-
addSignaturesToConfiguration
Deprecated.This method will be removed in Gradle 10.Add the signatures from the Sign task as artifacts to the given configuration- Since:
- 1.0
-
sign
Digitally signs the publish artifacts, generating signature files alongside them.The project's default signatory and default signature type from the
signing settingswill be used to generate the signature. The returnedsign operationgives access to the created signature files.If there is no configured default signatory available, the sign operation will fail.
- Parameters:
publishArtifacts- The publish artifacts to sign- Returns:
- The executed
sign operation - Since:
- 1.0
-
sign
Digitally signs the files, generating signature files alongside them.The project's default signatory and default signature type from the
signing settingswill be used to generate the signature. The returnedsign operationgives access to the created signature files.If there is no configured default signatory available, the sign operation will fail.
- Parameters:
files- The files to sign.- Returns:
- The executed
sign operation. - Since:
- 1.0
-
sign
Deprecated.This method will be removed in Gradle 10. Usesign(File...)instead.Digitally signs the files, generating signature files alongside them.The project's default signatory and default signature type from the
signing settingswill be used to generate the signature. The returnedsign operationgives access to the created signature files.If there is no configured default signatory available, the sign operation will fail.
- Parameters:
classifier- The classifier to assign to the created signature artifacts.files- The publish artifacts to sign.- Returns:
- The executed
sign operation. - Since:
- 1.0
-
sign
Creates a newsign operationusing the given closure to configure it before executing it.The project's default signatory and default signature type from the
signing settingswill be used to generate the signature. The returnedsign operationgives 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.
- Parameters:
closure- The configuration of thesign operation.- Returns:
- The executed
sign operation. - Since:
- 1.0
-
sign
Creates a newsign operationusing the given action to configure it before executing it.The project's default signatory and default signature type from the
signing settingswill be used to generate the signature. The returnedsign operationgives 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.
- Parameters:
setup- The configuration action of thesign operation.- Returns:
- The executed
sign operation. - Since:
- 7.5
-
doSignOperation
@Deprecated protected SignOperation doSignOperation(@DelegatesTo(SignOperation.class) Closure<?> setup) Deprecated.This method will be removed in Gradle 10.Perform a sign operation.- Since:
- 1.0
-
doSignOperation
Deprecated.This method will be removed in Gradle 10.Perform a sign operation.- Since:
- 2.14
-
getSignatories
-