Skip to content

Instantly share code, notes, and snippets.

@NickJian
Created May 23, 2017 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickJian/389490207a4ba516535629b03dcd7678 to your computer and use it in GitHub Desktop.
Save NickJian/389490207a4ba516535629b03dcd7678 to your computer and use it in GitHub Desktop.
split apk- build version code setting
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
// Stores the value of ext.abiCodes that is associated with the ABI for this variant.
def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
// Assigns a different version code for each output APK other than the universal APK.
if (baseAbiVersionCode != null) {
output.versionCodeOverride = baseAbiVersionCode * 1000 + variant.versionCode
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment