Update build script for wider Gradle compatibility.