Skip to content

Instantly share code, notes, and snippets.

@Lien
Created October 25, 2013 06:57
Show Gist options
  • Save Lien/7150434 to your computer and use it in GitHub Desktop.
Save Lien/7150434 to your computer and use it in GitHub Desktop.
Simple gradle sign jar task using ant task.
task signJar << {
description = "Signs JAR"
def config = loadProperties(project.ext.keystorePropsFilename)
ant.signjar(jar: project.ext.jarToSign,
alias: config.key.alias,
keystore: config.key.store,
storepass: config.key.'store.password',
keypass: config.key.'alias.password')
}
def loadProperties(propsFilename) {
def props = new Properties()
new File(propsFilename).withInputStream {
stream -> props.load(stream)
}
return new ConfigSlurper().parse(props)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment