You could even say project.eclipseClean instead of
project.tasks['eclipseClean'] if I'm not mistaken.

On Tue, Oct 20, 2009 at 6:10 PM, Peter Voss <[email protected]> wrote:

> Hi,
>
> I have figured it out on my own.
>
> On 20.10.2009, at 12:38, Peter Voss wrote:
>
>  Hi,
>>
>> first of all congratulations to gradle. I have just successfully migrated
>> a multi-project web application from Maven to gradle and was surprised how
>> easy this is now. The user guide was very helpful.
>>
>> I now want to extend the eclipseClean task to also remove the .settings
>> directory. I using this in one of my sub projects:
>> eclipseClean.doLast {
>>   ant.delete(dir: ".settings")
>> }
>>
>> That works, but I want to have this for all of my subprojects, so I tried
>> this from the top level build script, but failed:
>> subprojects {
>>   usePlugin "eclipse"
>>
>>   eclipseClean.doLast {
>>       ant.delete(dir: ".settings")
>>   }
>> }
>>
>>
> this should be:
>
> subprojects {
>    usePlugin "eclipse"
>
>    afterEvaluate {project ->
>        project.tasks["eclipseClean"].doLast {
>            ant.delete(dir: "${project.projectDir}/.settings")
>        }
>    }
> }
>
> This works. :-)
>
> --Peter
>
>
>
>  But this doesn't work anymore:
>> FAILURE: Build failed with an exception.
>>
>> * Where:
>> Build file '/Users/pvoss/Documents/horizont/git/webproject/build.gradle'
>> line: 4
>>
>> * What went wrong:
>> A problem occurred evaluating root project 'webproject'.
>> Cause: Could not find property 'eclipseClean' on project
>> ':integration-tests'.
>>
>> Any ideas?
>>
>> --Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>  http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to