What happened to Jar#merge() method?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What happened to Jar#merge() method?

sdevijver
Hey,

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

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)
    }
}

The 0.8 groovydoc still has the merge() method:


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 | Threaded
Open this post in threaded view
|

Re: What happened to Jar#merge() method?

hans_d
Administrator
<base href="x-msg://929/">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



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)
    }
}

The 0.8 groovydoc still has the merge() method:


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 | Threaded
Open this post in threaded view
|

Re: What happened to Jar#merge() method?

Tomek Kaczanowski-3
In reply to this post by sdevijver
Hi Steven,

> 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:
I've added a note that this is valid only for Gradle 0.8. Thanks for
pointing this out. I'll add the snippets for 0.9 version soon.

--
Tomek

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: What happened to Jar#merge() method?

Adam Murdoch-2
In reply to this post by sdevijver
Hi,

Just to let people know: We usually add API changes like this to the 'breaking changes' wiki page:

http://docs.codehaus.org/display/GRADLE/Gradle+0.9+Breaking+Changes

I try to keep this page up-to-date as soon as the change is committed (sometimes I forget). The javadocs and userguide and the wiki and everything else tends to take a bit longer to get updated.


Steven Devijver wrote:
Hey,

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

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)
    }
}

The 0.8 groovydoc still has the merge() method:


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


-- 
Adam Murdoch
Gradle Developer
http://www.gradle.org