Skip to content

Commit 38de500

Browse files
committed
fix
1 parent b9b9378 commit 38de500

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

build.gradle

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,42 @@ publishing {
151151
}
152152
}
153153

154-
project.tasks.withType(Sign) {
155-
signatures.all {
156-
def type = it.type
157-
if (it.file.name.endsWith('.tar.gz.asc')) { // Workaround in case a tar.gz file should published
158-
type = 'tar.gz.asc'
159-
} else if (it.type.equals('xml.asc')) { // Set correct extension for signature of pom file
160-
type = 'pom.asc'
154+
// project.tasks.withType(Sign) {
155+
// signatures.all {
156+
// def type = it.type
157+
// if (it.file.name.endsWith('.tar.gz.asc')) { // Workaround in case a tar.gz file should published
158+
// type = 'tar.gz.asc'
159+
// } else if (it.type.equals('xml.asc')) { // Set correct extension for signature of pom file
160+
// type = 'pom.asc'
161+
// }
162+
// artifact source: it.file, classifier: it.classifier ?: null, extension: type
163+
// }
164+
// }
165+
166+
pom.withXml {
167+
writeTo(project.ext.pomFile)
168+
def pomAscFile = signing.sign(project.ext.pomFile).signatureFiles[0]
169+
artifact(pomAscFile) {
170+
classifier = null
171+
extension = 'pom.asc'
172+
}
173+
project.ext.pomFile.delete()
174+
}
175+
176+
// Sign the artifacts.
177+
project.tasks.signArchives.signatureFiles.each {
178+
artifact(it) {
179+
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
180+
if (matcher.find()) {
181+
classifier = matcher.group(1)
182+
} else {
183+
classifier = null
161184
}
162-
artifact source: it.file, classifier: it.classifier ?: null, extension: type
185+
extension = 'jar.asc'
163186
}
164187
}
165188

189+
166190
}
167191
}
168192
}

0 commit comments

Comments
 (0)