Merge pull request #728 from AbrarSyed/patch-1
made signing task more generic
This commit is contained in:
commit
8ad3400b0c
1 changed files with 15 additions and 8 deletions
23
build.gradle
23
build.gradle
|
@ -104,25 +104,32 @@ if (!project.hasProperty("keystore_password")) // keystore stuff
|
||||||
if (!project.hasProperty("ee3_keystore_alias")) // keystore stuff
|
if (!project.hasProperty("ee3_keystore_alias")) // keystore stuff
|
||||||
ext.ee3_keystore_alias = ""
|
ext.ee3_keystore_alias = ""
|
||||||
|
|
||||||
task signJar(dependsOn: "reobf") {
|
task signJar(dependsOn: ["reobf", "devJar"]) {
|
||||||
inputs.file jar.getArchivePath()
|
inputs.dir jar.destinationDir
|
||||||
inputs.file keystore_location
|
inputs.file keystore_location
|
||||||
inputs.property "ee3_keystore_alias", ee3_keystore_alias
|
inputs.property "ee3_keystore_alias", ee3_keystore_alias
|
||||||
inputs.property "keystore_password", keystore_password
|
inputs.property "keystore_password", keystore_password
|
||||||
outputs.file jar.getArchivePath()
|
outputs.dir devJar.destinationDir
|
||||||
|
|
||||||
// only sign if the keystore exists
|
// only sign if the keystore exists
|
||||||
onlyIf {
|
onlyIf {
|
||||||
return keystore_location != "." && keystore_password != ""
|
return keystore_location != "." && keystore_password != ""
|
||||||
}
|
}
|
||||||
// the actual action.. sign the jar.
|
// the actual action.. sign the jar.
|
||||||
doLast {
|
doLast {
|
||||||
ant.signjar(
|
jar.destinationDir.eachFile { file ->
|
||||||
destDir: jar.destinationDir,
|
if (!file.getPath().endsWith(".jar"))
|
||||||
jar: jar.getArchivePath(),
|
return; // skip non-jars
|
||||||
|
|
||||||
|
logger.lifecycle "signing $file"
|
||||||
|
ant.signjar(
|
||||||
|
destDir: file.getParentFile(), // same place it came from
|
||||||
|
jar: file,
|
||||||
keystore: keystore_location,
|
keystore: keystore_location,
|
||||||
alias: ee3_keystore_alias,
|
alias: ee3_keystore_alias,
|
||||||
storepass: keystore_password
|
storepass: keystore_password
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,4 +186,4 @@ uploadArchives {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue