BuildInvocations.getTasks() for Gradle 1.12.
BuildInvocations.getTasks() adapter for 1.8-1.11 providers.