From 04bdf72504fd270672b09839586327adbaa47a92 Mon Sep 17 00:00:00 2001 From: Pahimar Date: Wed, 3 Sep 2014 15:54:07 -0400 Subject: [PATCH] Sign the jar! SIGN IT! :) --- build.gradle | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/build.gradle b/build.gradle index 089f2194..99d11f04 100644 --- a/build.gradle +++ b/build.gradle @@ -95,6 +95,36 @@ task createChangelog(type: ChangelogTask) { } tasks.build.dependsOn('createChangelog') +tasks.build.dependsOn('signJar') + +if (!project.hasProperty("keystore_location")) // keystore stuff + ext.keystore_location = "." +if (!project.hasProperty("keystore_password")) // keystore stuff + ext.keystore_password = "" +if (!project.hasProperty("ee3_keystore_alias")) // keystore stuff + ext.ee3_keystore_alias = "" + +task signJar(dependsOn: "reobf") { + inputs.file jar.getArchivePath() + inputs.file keystore_location + inputs.property "ee3_keystore_alias", ee3_keystore_alias + inputs.property "keystore_password", keystore_password + outputs.file jar.getArchivePath() + // only sign if the keystore exists + onlyIf { + return keystore_location != "." && keystore_password != "" + } + // the actual action.. sign the jar. + doLast { + ant.signjar( + destDir: jar.destinationDir, + jar: jar.getArchivePath(), + keystore: keystore_location, + alias: ee3_keystore_alias, + storepass: keystore_password + ) + } +} uploadArchives { repositories {