How to replace existing task with a custom task


(greg.gigon) #1

Hi I’ve got a plugin with a custom task. The task is a test runner task. The thing is, I would like to replace test task with my custom task. So when I call gradle test I would like mine test task to run, not the java/groovy plugin task. Or perhaps there is a better way of doing it? I’m open for suggestions.

One more thing, how can I use project logger with status logging like a test task? What I mean is that the new lines are not created, only number of executed tests increases in the terminal window.

Greg


(Peter Niederwieser) #2

You can use ‘tasks.add(name: “test”, type: MyTest, overwrite: true)’. Another option is to disable the ‘test’ task and add your own task with a different name.

You should be able to send Ansi escape sequences to ‘System.out’.