Last active
February 26, 2018 13:45
-
-
Save igorwojda/d2b2c3b9db7fe64bc3fb6228789c810d to your computer and use it in GitHub Desktop.
Configure apk split version codes
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
import com.android.build.OutputFile | |
android { | |
splits { | |
//... | |
} | |
// Map for the version code that gives each ABI a value. | |
def abiCodes = ['x86':1, 'x86_64':2, 'armeabi-v7a':3, 'arm64-v8a':4] | |
// APKs for the same app that all have the same version information. | |
android.applicationVariants.all { variant -> | |
// Assigns a different version code for each output APK. | |
variant.outputs.each { | |
output -> | |
def abiName = output.getFilter(OutputFile.ABI) | |
output.versionCodeOverride = abiCodes.get(abiName, 0) * 100000 + variant.versionCode | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment