How to execute a task in unit test for custom plugin

‘ProjectBuilder’ is meant for lower-level tests that do not execute a build. It’s a good fit for testing how plugins configure the object model. More comprehensive testing support will be provided in the future. In the meantime you can, with some effort, use ‘GradleLauncher’ to write tests that execute a build. I believe you can find some more information by searching the forum and mailing list.