Merge Gradle template

Update Gradle and build config.