Add ability to sign directly from Gradle with the right user properties file
@@ -6,6 +6,7 @@ plugins {
id 'maven'
id 'com.github.johnrengelman.shadow' version '1.2.3'
id 'java'
+ id 'org.spongepowered.plugin' version '0.8.1'
// id "com.qixalite.spongestart" version "1.4.3"
}
@@ -34,6 +35,8 @@ allprojects {
}
}
+apply plugin: 'signing'
+
description = 'The Ultimate Essentials Plugin.'
ext.url = 'http://nucleuspowered.org'
@@ -155,7 +158,7 @@ shadowJar.dependsOn([':nucleus-api:build'])
task cleanJars() {
project.file('output').listFiles().each {
- x -> if (x.name.endsWith("jar")) { x.delete() }
+ x -> if (x.name.endsWith("jar") || x.name.endsWith("asc")) { x.delete() }
}
}
@@ -168,6 +171,21 @@ artifacts {
archives shadowJar
}
+signing {
+ sign shadowJar
+}
+
+task copyAsc(type: Copy, dependsOn: 'signShadowJar') {
+ from([signShadowJar.getSignatureFiles()])
+ into project.file('output')
+}
+
+task buildAndSign {
+ dependsOn 'build'
+ dependsOn 'signShadowJar'
+ dependsOn 'copyAsc'
+}
+
static String getGitHash() {
def process = 'git rev-parse --short HEAD'.execute()
process.waitFor()
@@ -179,3 +197,5 @@ clean.dependsOn(cleanJars)
copyJars.mustRunAfter(cleanJars)
build.dependsOn(shadowJar)
build.dependsOn(copyJars)
+signShadowJar.dependsOn(shadowJar)
+copyAsc.dependsOn(signShadowJar)
