VERSION versionCode buildVersionCode() // => 1020300 } } def buildVersionCode() { def (major, minor, patch) = VERSION.tokenize(‘.’) (major*1000000) + (minor*10000) + (patch*100) } https://blog.jayway.com/2015/03/11/automatic-versioncode-generation-in-android-gradle/