richardm wrote:
> 
> However, my questions still stands, can you update a JAR using the Gradle
> DSL, or is using the Ant task the only way?
> 

Gradle's file handling capabilities make this kind of task easy. For
example, to add file "some_file.txt" to the META-INF directory of the
original Jar:

task enrichedJar(type: Jar, dependsOn: "jar") {
    appendix = "enriched"
    from zipTree(jar.archivePath) // add original content
    from(file("some_file.txt")) {   // add new content
        into "META-INF"
    }
}

For more information, see the chapter "Working With Files" in the user
guide:
http://gradle.org/latest/docs/userguide/userguide_single.html#working_with_files

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradleware
http://www.gradleware.com
Creator, Spock Framework
http://spockframework.org


--
View this message in context: 
http://gradle.1045684.n5.nabble.com/is-it-possible-to-update-jar-contents-tp3407766p3407972.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


Reply via email to