Skip to content

Instantly share code, notes, and snippets.

@gogeta95
Last active September 23, 2016 21:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gogeta95/78d8d8236ef8a7ce58be091317738e1e to your computer and use it in GitHub Desktop.
Save gogeta95/78d8d8236ef8a7ce58be091317738e1e to your computer and use it in GitHub Desktop.
Enable different build numbers for different ABIs.
android {
//.....
}
// map for the version code that gives each ABI a value. make sure to list all ABIs mentioned in splits block, an keep the order.
ext.versionCodes = ['armeabi': 3, 'armeabi-v7a': 4, 'arm64-v8a': 5, mips: 6, 'x86': 7, 'x86_64': 8]
import com.android.build.OutputFile
// For each APK output variant, override versionCode with a combination of
// ABI APK value * 1000 + defaultConfig.versionCode
android.applicationVariants.all { variant ->
// assign different version code for each output
variant.outputs.each { output ->
output.versionCodeOverride =
project.ext.versionCodes.get(output.getFilter(OutputFile.ABI)) * 1000 + android.defaultConfig.versionCode
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment