Fix problems with optional dependency on Gradle tooling.