In your gradle.properties file store the same values as in the ant.properties file, I think you'll have to do simpler names, like keyAlias for instance. Just remove the dots to be sure.
then in your build.gradle file do something like this:
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
if (project.hasProperty('keyAlias')) {
android.signingConfigs.release.keyAlias = keyAlias
}
// do the same for the three other properties
// ...
Doing it this way gives you flexibility to build on a computer that has the gradle.properties file or not. The "keyalias" property is only read if it exists so the code with not fail if it's not there.
If all the properties are there, signingConfigs.release will be fully configured and will be used to sign the apk during the build. If it's not there, the APK will be built but not signed.