What should we replace GradleLauncher.newInstance(startParameter) with?

we use this for running spock integration tests

I think the idea is to use the Gradle tooling API instead (see the tooling API samples in the full Gradle distribution). However, personally I think it’s not quite there yet (for the purpose of integration testing Gradle plugins).

I’m also trying to find a replacement using the tooling api. The problem I have is that the GradleLauncher.run() method returns a BuildResult which we use, but there seems to be no equivalent in the tooling api. How do I get a buildResult from BuildLauncher.run()?