Skip to content

Commit

Permalink
Sign
Browse files Browse the repository at this point in the history
  • Loading branch information
Kotori316 committed Oct 22, 2023
1 parent dc4fc6d commit 2350e35
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -300,26 +300,30 @@ publishing {
}

tasks.register("jksSignJar") {
dependsOn(tasks.shadowJar, tasks.reobfJar)
dependsOn(tasks.shadowJar, tasks.reobfJar, tasks.reobfJarJar, tasks.srcJar)
boolean executeCondition = project.hasProperty("jarSign.keyAlias") &&
project.hasProperty("jarSign.keyLocation") &&
project.hasProperty("jarSign.storePass")
onlyIf { executeCondition }
doLast {
//noinspection HttpUrlsUsage
ant.signjar(
jar: tasks.shadowJar.archiveFile.get(),
alias: project.findProperty("jarSign.keyAlias") ?: "",
keystore: project.findProperty("jarSign.keyLocation") ?: "",
storepass: project.findProperty("jarSign.storePass") ?: "",
sigalg: "Ed25519",
digestalg: "SHA-256",
tsaurl: "http://timestamp.digicert.com",
)
for (def t : [tasks.jar, tasks.shadowJar, tasks.srcJar, tasks.jarJar]) {
//noinspection HttpUrlsUsage
ant.signjar(
jar: t.archiveFile.get(),
alias: project.findProperty("jarSign.keyAlias") ?: "",
keystore: project.findProperty("jarSign.keyLocation") ?: "",
storepass: project.findProperty("jarSign.storePass") ?: "",
sigalg: "Ed25519",
digestalg: "SHA-256",
tsaurl: "http://timestamp.digicert.com",
)
}
}
}

tasks.named("assemble").get().dependsOn("jksSignJar")
tasks.named("assemble") {
dependsOn("jksSignJar")
}

signing {
sign(publishing.publications)
Expand Down

0 comments on commit 2350e35

Please sign in to comment.