Hi Hans, I have tested with 0.8 and 0.9 and cannot reproduce this again, so probably it was just a mistake on my side. I remember reviewing it three times, so I don't understand how this could happen. Sorry.
OTOH, I will try the snapshot way, as it seems much cleaner. Thanks! On Wed, Jan 20, 2010 at 11:40 AM, Hans Dockter <[email protected]> wrote: > Hi Nacho, > > On Tue, Jan 19, 2010 at 1:09 PM, Nacho Coloma <[email protected]> wrote: >> >> I am defining this task in my master project: >> >> subprojects { >> >> task 'cleanGenlib' << { >> ant.delete(dir: "${projectDir}/src/main/genlib") >> ant.delete(dir: "${projectDir}/src/test/genlib") >> } >> clean.dependsOn cleanGenlib >> >> } >> >> Now, invoking "gradle clean" in a subproject triggers cleanGenlib on >> all subprojects, not just the one I am working in (which is the >> expected behavior). >> >> Is this the way it's supposed to be, or am I missing something? > > No, it is not supposed to work like this. And I can't reproduce this with > Gradle trunk. I have added your code to the > GRADLE_HOME/samples/java/multiproject build. > > Executing gradle clean within the api dir gives me the following: > > :api:cleanGenlib > :api:clean > > The same is true for executing gradle :api:clean from the root dir. > > Executing clean from the root dir gives me (as expected) > > :api:cleanGenlib > :api:clean > :services:cleanGenlib > :services:clean > :shared:cleanGenlib > :shared:clean > :services:webservice:cleanGenlib > :services:webservice:clean > > I'm interested in what's going on there. The newest Gradle provides a > built-in solution for this: > > subprojects { > clean { > from "$projectDir/src/main/genlib", "$projectDir/src/test/genlib" > } > } > > - Hans > > -- > Hans Dockter > Founder, Gradle > http://www.gradle.org, http://twitter.com/gradleorg > CEO, Gradle Inc. - Gradle Training, Support, Consulting > http://www.gradle.biz > >> >> Regards, >> >> Nacho. >> >> --------------------------------------------------------------------- >> 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
