Update Gradle script to remove deprecated feature and make things work for 2.0-rc-1 as well as 1.12.