Skip to content

Commit

Permalink
add in automated maven deploys for use on DVS1, and signing to be use…
Browse files Browse the repository at this point in the history
…d by both servers
  • Loading branch information
progwml6 committed Feb 10, 2014
1 parent 7ed1eb4 commit a8c00f7
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion build.gradle
Expand Up @@ -47,6 +47,7 @@ repositories {

// Load ForgeGradle
apply plugin: 'forge'
group = 'tconstruct'

// Define properties file
ext.configFile = file "build.properties"
Expand Down Expand Up @@ -116,7 +117,6 @@ minecraft {
replace '${version}', project.version
}


sourceSets {
main {
resources {
Expand Down Expand Up @@ -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
Expand All @@ -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}")
}
}
}
}
}


0 comments on commit a8c00f7

Please sign in to comment.