diff --git a/build.gradle b/build.gradle index a970492..51f3576 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ plugins { apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.2.2" +version = "1.2.3" group= "ljfa.tntutils" archivesBaseName = "tnt_utilities-mc1.12" @@ -72,3 +72,23 @@ processResources { exclude 'mcmod.info' } } + +task signJar(type: SignJar, dependsOn: reobfJar) { + // Skips if the keyStore property is missing. + onlyIf { + project.hasProperty('keyStore') + } + + // findProperty allows us to reference the property without it existing. + // Using project.propName would cause the script to fail validation if + // the property did not exist. + keyStore = project.findProperty('keyStore') + alias = project.findProperty('keyStoreAlias') + storePass = project.findProperty('keyStorePass') + keyPass = project.findProperty('keyStoreKeyPass') + inputFile = jar.archivePath + outputFile = jar.archivePath +} + +// Runs this task automatically when reobfJar is ran. +reobfJar.finalizedBy signJar