mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
Simplify signing config (#4971)
This commit is contained in:
@@ -66,10 +66,12 @@ if (signingKey.isNullOrBlank() || signingPwd.isNullOrBlank()) {
|
||||
logger.info("Signing disabled as the GPG key was not found")
|
||||
} else {
|
||||
logger.info("GPG Key found - Signing enabled")
|
||||
signing {
|
||||
useInMemoryPgpKeys(signingKey, signingPwd)
|
||||
publishing.publications.forEach(::sign)
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
useInMemoryPgpKeys(signingKey, signingPwd)
|
||||
sign(publishing.publications)
|
||||
isRequired = !(signingKey.isNullOrBlank() || signingPwd.isNullOrBlank())
|
||||
}
|
||||
|
||||
val String.byProperty: String? get() = findProperty(this) as? String
|
||||
|
||||
@@ -6,7 +6,6 @@ plugins {
|
||||
`java-gradle-plugin`
|
||||
`java-test-fixtures`
|
||||
idea
|
||||
signing
|
||||
alias(libs.plugins.pluginPublishing)
|
||||
// We use this published version of the Detekt plugin to self analyse this project.
|
||||
id("io.gitlab.arturbosch.detekt") version "1.20.0"
|
||||
@@ -166,20 +165,6 @@ tasks.withType<Sign>().configureEach {
|
||||
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13470")
|
||||
}
|
||||
|
||||
val signingKey = "SIGNING_KEY".byProperty
|
||||
val signingPwd = "SIGNING_PWD".byProperty
|
||||
if (signingKey.isNullOrBlank() || signingPwd.isNullOrBlank()) {
|
||||
logger.info("Signing disabled as the GPG key was not found")
|
||||
} else {
|
||||
logger.info("GPG Key found - Signing enabled")
|
||||
afterEvaluate {
|
||||
signing {
|
||||
useInMemoryPgpKeys(signingKey, signingPwd)
|
||||
publishing.publications.forEach(::sign)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
publishing {
|
||||
publications.filterIsInstance<MavenPublication>().forEach {
|
||||
|
||||
Reference in New Issue
Block a user