On Wed, Mar 23, 2011 at 3:41 PM, shadowlaw <[email protected]> wrote:
> in case someone need it, i've done it this way
>
> task copyToLib(dependsOn: configurations.default.buildArtifacts, type:
> Copy)
> {
> into "$buildDir/output/lib"
> from configurations.default
> from configurations.default.allArtifactFiles
> }
> then call my task like this
> defaultTasks: 'copyToLib'
>
> without declaring the defaultTasks line gradle does not execute my task. I
> don't know why
> may someone can explain!!!
>
gradle only executes tasks in the default lifecycle. you could run "gradle
copyToLib".
you can also hook it into a lifecycle task by using
someLifecycleTask.dependsOn("copyToLib"). e.g:
prepareResources.dependsOn("copyToLib")
This way, "copyToLib" will be executed before "prepareResources". you could
hook into any task that is executed by default (the available tasks depends
on your plugins - e.g. jar or compileJava for java plugin).
If it executed all custom tasks, you would have no control over which custom
tasks were executed as specific lifecycle points.