On Tue, Jun 1, 2010 at 6:43 AM, Adam Murdoch <[email protected]> wrote:
>
>
> On 1/06/10 1:29 AM, szczepiq wrote:
>
>> Hey guys,
>>
>> I cannot get include/exclude to work with 'test' task. Here's my gradle:
>>
>> ant.importBuild 'build.xml'
>>
>> usePlugin 'java'
>>
>> test {
>> testClassesDir = file('../automatedbuild/classes')
>> scanForTestClasses = false
>> include = '**/CreditLimitsTest.class'
>> forkEvery = null
>> exclude = '**/*.*'
>> }
>>
>> The problem is that it always picks up all tests for execution, rather
>> than the single one I expect. I played with various configuration entries
>> but it always picks up all tests.
>>
>>
> There's no 'include' or 'exclude' property on Test. The properties are
> actually called 'includes' and 'excludes'. So, test { include = '...' } is
> simply setting a dynamic property called 'include' on the test task. Which
> doesn't do anything.
>
> You need to set the 'includes' property: test { includes = [ '...' ] } or
> use the include() convenience method: test { include '...' }
>
> Things like this make me wonder whether dynamic properties for tasks (and
> projects) are actually a bad idea.
>
As soon as we make the declarative in 1.0 this trap will go away.
- Hans
--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz