Skip to content

Commit 998ac20

Browse files
test another signing approach
1 parent 5d8effd commit 998ac20

1 file changed

Lines changed: 28 additions & 20 deletions

File tree

build.gradle

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,23 @@ publishing {
135135
}
136136

137137
// Sign the artifacts.
138-
project.tasks.signArchives.signatureFiles.each {
139-
artifact(it) {
140-
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
141-
def zipMatcher = it.file =~ /\.(zip|tar)\.asc$/
142-
def extensionPrefix = 'jar'
143-
// if (zipMatcher.find()) {
144-
// extensionPrefix = zipMatcher.group(1)
138+
// project.tasks.signArchives.signatureFiles.each {
139+
// artifact(it) {
140+
// def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
141+
// def zipMatcher = it.file =~ /\.(zip|tar)\.asc$/
142+
// def extensionPrefix = 'jar'
143+
//// if (zipMatcher.find()) {
144+
//// extensionPrefix = zipMatcher.group(1)
145+
//// }
146+
// if (matcher.find()) {
147+
// classifier = matcher.group(1)
148+
// } else {
149+
// classifier = null
145150
// }
146-
if (matcher.find()) {
147-
classifier = matcher.group(1)
148-
} else {
149-
classifier = null
150-
}
151-
152-
extension = extensionPrefix + '.asc'
153-
}
154-
}
151+
//
152+
// extension = extensionPrefix + '.asc'
153+
// }
154+
// }
155155
}
156156
}
157157

@@ -168,10 +168,18 @@ publishing {
168168
}
169169
}
170170

171-
model {
172-
tasks.publishJarPublicationToStagingRepository {
173-
dependsOn(project.tasks.signArchives)
174-
}
171+
//model {
172+
// tasks.publishJarPublicationToStagingRepository {
173+
// dependsOn(project.tasks.signArchives)
174+
// }
175+
//}
176+
177+
signing {
178+
required { gradle.taskGraph.hasTask("publish") }
179+
def signingKey = "${signing.keyId}"
180+
def signingPassword = "${signing.password}"
181+
useInMemoryPgpKeys(signingKey, signingPassword)
182+
sign publishing.publications.jar
175183
}
176184

177185
distributions {

0 commit comments

Comments
 (0)