On 28/03/2012, at 12:20 AM, Adam Murdoch <adam.murd...@gradleware.com> wrote:
>
> On 27/03/2012, at 11:19 PM, Luke Daley wrote:
>
>>
>> On 27/03/2012, at 1:12 PM, k4rn4k wrote:
>>
>>> Hello,
>>>
>>> Im setting this task outputs like shown in the user guide, but It's always
>>> being resolved as "up to date as it has no source files".
>>>
>>> task buildExplodedWar(type: Copy)<<{
>>> //Configuring inputs/outputs
>>> destDir = new File ("$project.buildDir/war")
>>> project.configurations.runtime.each{srcFile ->
>>> inputs.file srcFile
>>> }
>>> outputs.dir destDir
>>> //Some copy behaviour
>>> }
>>
>> The problem is that you are setting them during task execution.
>>
>> You need to rewrite as this:
>>
>> task configureBuildExplodedWar << {
>> project.configurations.runtime.each { srcFile ->
>> buildExplodedWar.from srcFile
>> }
>> }
>>
>> task buildExplodedWar(type: Copy, dependsOn: configureBuildExplodedWar) {
>> destination "$project.buildDir/war"
>> }
>
>
> Or even just
>
> task buildExplodedWar(type: Copy) {
> from configurations.runtime
> destination "$project.buildDir/war"
> }
Ha, indeed. Forest for the trees.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email