diff --git a/build.gradle b/build.gradle index cd115536792..c395c924f79 100644 --- a/build.gradle +++ b/build.gradle @@ -47,6 +47,7 @@ repositories { // Load ForgeGradle apply plugin: 'forge' +group = 'tconstruct' // Define properties file ext.configFile = file "build.properties" @@ -116,7 +117,6 @@ minecraft { replace '${version}', project.version } - sourceSets { main { resources { @@ -151,6 +151,10 @@ jar { task deobfJar(type: Jar) { from sourceSets.main.output classifier = 'deobf' + manifest { + attributes 'FMLCorePlugin': 'tconstruct.preloader.TConstructLoaderContainer' + attributes 'FMLCorePluginContainsFMLMod': 'true' + } } // Create API library jar @@ -165,4 +169,55 @@ artifacts { archives deobfJar archives libJar } +// verify the properties exist.. or initialize. +if (!project.hasProperty("keystore_location")) // keystore location + ext.keystore_location = "."; + +if (!project.hasProperty("keystore_user_alias")) // keystore user alias + ext.keystore_user_alias = ""; + +if (!project.hasProperty("keystore_user_password")) // keystore user pass + ext.keystore_user_password = ""; + +task("signJar", dependsOn: "build") +{ + inputs.file jar.getArchivePath() + inputs.file keystore_location + inputs.property "keystore_user_alias", keystore_user_alias + inputs.property "keystore_user_password", keystore_user_password + outputs.file jar.getArchivePath() + + // only sign if the keystore exists + onlyIf { + return keystore_location != "." + } + + // the actual action.. sign the jar. + doLast { + ant.signjar( + destDir: jar.destinationDir, + jar: jar.getArchivePath(), + keystore: keystore_location, + alias: keystore_user_alias, + storepass: keystore_user_password + ) + } +} + +task("uploadJars", dependsOn:"signJar") { + + description = "uploads JARs" + + if (project.hasProperty("local_maven")) { + apply plugin: 'maven' + uploadArchives { + repositories { + mavenDeployer { + repository(url: "file://${local_maven}") + } + } + } + } +} +