Last active
September 23, 2016 21:34
-
-
Save gogeta95/78d8d8236ef8a7ce58be091317738e1e to your computer and use it in GitHub Desktop.
Enable different build numbers for different ABIs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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