gradle: Small changes

This commit is contained in:
Owain van Brakel
2021-11-06 03:00:06 +01:00
parent 9693994fbf
commit 8be8b50a52
2 changed files with 31 additions and 26 deletions

View File

@@ -115,30 +115,6 @@ subprojects {
isIgnoreFailures = false
}
}
tasks.withType<Jar> {
doLast {
// sign jar
if (System.getProperty("signKeyStore") != null) {
// ensure ant is initialized so we can copy the project variable later
ant.invokeMethod("echo", mapOf("message" to "initializing ant"))
for (file in outputs.files) {
org.apache.tools.ant.taskdefs.SignJar().apply {
// why is this required
project = ant.project
setKeystore(System.getProperty("signKeyStore"))
setStorepass(System.getProperty("signStorePass"))
setAlias(System.getProperty("signAlias"))
setJar(file)
setSignedjar(file)
execute()
}
}
}
}
}
configure<PublishingExtension> {
repositories {
@@ -186,6 +162,30 @@ subprojects {
exclude("**/LayoutSolver.java")
exclude("**/RoomType.java")
}
withType<Jar> {
doLast {
// sign jar
if (System.getProperty("signKeyStore") != null) {
// ensure ant is initialized so we can copy the project variable later
ant.invokeMethod("echo", mapOf("message" to "initializing ant"))
for (file in outputs.files) {
org.apache.tools.ant.taskdefs.SignJar().apply {
// why is this required
project = ant.project
setKeystore(System.getProperty("signKeyStore"))
setStorepass(System.getProperty("signStorePass"))
setAlias(System.getProperty("signAlias"))
setJar(file)
setSignedjar(file)
execute()
}
}
}
}
}
}
configurations["compileOnly"].extendsFrom(configurations["annotationProcessor"])