Hi Steven,

On Oct 26, 2009, at 3:40 PM, Steven Devijver wrote:

Hey,

It seems the Jar class doesn't have the merge() method (anymore?):

this is true. We have some more generic mechanism now. There is now a tarTree and zipTree method in the project which creates objects of the respective type. You can use them now in the copy as well as the zip task in similar ways. For the archive tasks this is replacing the merge functionality.

task copy(type: Copy) {
    from tarTree('test.tar')
    exclude '**/*.xml'
    into buildDir
}

task zip(type: Zip) {
    from zipTree('test.zip')
    from tarTree('test.tar')
    fileSet(dir: 'test')
    destinationDir = buildDir
    customName = 'test.zip'
}

- Hans

--
Hans Dockter
Gradle Project Manager
http://www.gradle.org



println jar.metaClass.methods*.name

[equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait, capt ureStandardOutput, compareTo, compareTo, deleteAllActions, dependsOn, dependsOnT askDidWork, disableStandardOutputCapture, doFirst, doLast, equals, execute, getA ctions, getAdditionalProperties, getAnt, getAsDynamicObject, getConvention, getD ependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExe cuted, getExecuter, getInputs, getLogger, getName, getOnlyIf, getOutput, getOutp uts, getPath, getProject, getStandardOutputCapture, getTaskDependencies, hasProp erty, hashCode, injectIntoNewInstance, isEnabled, onlyIf, onlyIf, property, setA ctions, setAdditionalProperties, setConvention, setDependsOn, setDescription, se tDidWork, setEnabled, setExecuter, setName, setOutputHandler, setProject, setPro perty, setStandardOutputCapture, toString, configure, doFirst, doLast, getMetaCl ass, getProperty, invokeMethod, leftShift, setMetaClass, setProperty, convention Mapping, getConventionMapping, setConventionMapping, antDirective, fileSet, file Set, fileSet, fileSet, from, generateArchive, getAllSource, getAppendix, getArch iveName, getArchivePath, getBaseDir, getBaseName, getClassifier, getCreateIfEmpt y, getCustomName, getDestinationDir, getExtension, getMetaClass, getProperty, ge tResourceCollections, getVersion, invokeMethod, isCreateIfEmpty, resourceCollect ions, setAppendix, setBaseDir, setBaseName, setClassifier, setCreateIfEmpty, set CustomName, setDestinationDir, setExtension, setMetaClass, setProperty, setResou rceCollections, setVersion, createAntArchiveTask, getAntZip, setAntZip, zipFileS et, zipFileSet, zipFileSet, zipFileSet, createAntArchiveTask, getAntJar, getFile SetManifest, getManifest, getMetaInfResourceCollections, setAntJar, setFileSetMa nifest, setManifest, setMetaInfResourceCollections, getAllSource, getAntJar, get AntZip, getAppendix, getArchiveName, getArchivePath, getBaseDir, getBaseName, ge tClassifier, getCustomName, getDestinationDir, getExtension, getFileSetManifest, getManifest, getMetaInfResourceCollections, getResourceCollections, getVersion, methodMissing, propertyMissing, propertyMissing, setAntJar, setAntZip, setAppen dix, setBaseDir, setBaseName, setClassifier, setCustomName, setDestinationDir, s etExtension, setFileSetManifest, setManifest, setMetaInfResourceCollections, set
ResourceCollections, setVersion]

Strangely the cookbook does use it:

"Creating a fat jar":

jar.doFirst {
    for(file in configurations.compile) {
        jar.merge(file)
    }
}
http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Creatingafatjar

The 0.8 groovydoc still has the merge() method:

http://gradle.org/0.8/docs/groovydoc/org/gradle/api/tasks/bundling/AbstractArchiveTask.html#merge(Object[])

I'm using the latest HEAD:

------------------------------------------------------------
Gradle 0.9-20091026143227+0100
------------------------------------------------------------

Gradle buildtime: maandag 26 oktober 2009 14.32 u. CET
Groovy: 1.6.4
Ant: Apache Ant version 1.7.0 compiled on December 13 2006
Ivy: 2.1.0-rc2
Java: 1.6.0_16
JVM: 14.2-b01
JVM Vendor: Sun Microsystems Inc.
OS Name: Windows XP

Is there supposed to be a merge method or not?

Thanks

Steven



Reply via email to