| Author |
Gradle forcing test task to run
|
Wirianto Djunaidi
Ranch Hand
Joined: Mar 20, 2001
Posts: 195
|
|
I'm playing with Gradle at this moment and I notice that Gradle is quite smart in term of not running any of the tasks when nothing has changed, including the 'test' task. However sometime I do want to run the test task even when nothing has changed, because I want to look at the test report in the case I lost the console buffer already. What is the way to force the test task to run even when there is no change to the project? Of course I'm looking for idiomatic Gradle way, not touching the project to fake a change .
|
 |
Hubert Klein Ikkink
author
Greenhorn
Joined: Jan 10, 2013
Posts: 13
|
|
Hi Wirianto,
the easiest way is to first run cleanTest before the test task. So from the command-line you would enter:
$ gradle cleanTest test
or using task abbreviation:
$ gradle cT test
If you always want to run the test task you can add in your build file:
test.dependsOn 'cleanTest'
or define the task can never be UP-TO-DATE:
test.outputs.updateWhen { false }
|
 |
 |
|
|
subject: Gradle forcing test task to run
|
|
|