How to execute a task in a plugin test build?


(thirsch81) #1

When using the ProjectBuilder, is there any way to run the configured Project providing some task name? Would there be another way to test CustomTasks (that may rely on other plugins applied) in a comprehensive way?


(Peter Niederwieser) #2

‘ProjectBuilder’ is good for testing how plugins configure the build model. To execute tasks, you have to use the tooling API (see the samples in the full Gradle distribution) or the (deprecated) ‘GradleLauncher’ class. There are plans to provide more testing support in the future.


(Pablo Munoz) #3

Many folks have written test utilities based on GradleLauncher [1].

Any idea when more testing support will be provided to migrate to using tooling API for integration plugin tests?

[1] http://stackoverflow.com/questions/16264966/programatically-invoke-a-gradle-task-graph-in-a-unit-test