On 02/09/2011, at 1:14 PM, liptonik wrote:
> I have something like that in my build.gradle:
>
> task fatJar(dependsOn: jar, type: Jar) {
> classifier = 'FAT'
> from sourceSets.main.classes
> from configurations.compile.collect { it.isDirectory() ? it :
> zipTree(it) }
> manifest {
> def jars = configurations.runtime.resolve().name.join(' ')
> attributes 'Implementation-Title': 'Stock Watch',
> 'Implementation-Version': version,
> 'Main-Class' : 'stockwatch.Server',
> 'Class-Path': jars
> }
> }
>
>
> When I type gradle -i build I've got:
>
> Tasks to be executed: [task ':compileJava', task ':processResources', task
> ':classes', task ':jar', task ':*fatJar*'
>
> but I don't want it to be executed.
> Why it is ?
The build task invokes assemble, which builds every kind of “archive” defined
in your project. So any zip, jar, etc. type tasks are automatically
dependencies of the assemble task (which is a dependency of build).
> What should I do to skip my task when launch build task ?
You need to modify the dependencies of the assemble task:
assemble.dependsOn = assemble.dependsOn - [fatJar]
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email