richardm wrote:
>
> Is there a Gradle way to update the contents of a JAR? I couldn't see how
> to do this so have resorted to using an ant jar task (with update = true).
> However my attempt to update the JAR doesn't seem to be working. The task
> seems to run OK, but the JAR doesn't get updated.
>
> task updateJarWithIndex(dependsOn: generateJarIndex) {
> ant.jar(update: "true", destfile:
> "${project(':gui').libsDir}/uwm-gui.jar") {
> fileset(dir: "$projectDir", includes: 'META-INF/**')
> }
> }
>
> I need to update the JAR after it's been built. I'm updating with an
> INDEX.LIST file (as the JAR is an applet and we use INDEX.LIST instead of
> a classpath in the manifest to optimise the class loader).
>
I got the ant task working, I was just missing the doLast (<<) operator,
something which continues to confuse me when creating my own tasks
(particularly as many built in tasks like jar, copy etc don't require the
doLast operator).
task updateJarWithIndex(dependsOn: generateJarIndex) << {
ant.jar(update: "true", destfile:
"${project(':gui').libsDir}/uwm-gui.jar") {
fileset(dir: "$projectDir", includes: 'META-INF/**')
}
}
However, my questions still stands, can you update a JAR using the Gradle
DSL, or is using the Ant task the only way?
--
View this message in context:
http://gradle.1045684.n5.nabble.com/is-it-possible-to-update-jar-contents-tp3407766p3407829.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email