Created
September 23, 2017 19:14
-
-
Save Michcioperz/061a5244a4318e0ba1a8903e2e6077ea to your computer and use it in GitHub Desktop.
This file contains 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
ext.postBuildExtras = { | |
android.splits.density.enable = true | |
android.splits.density.compatibleScreens = ['small', 'normal', 'large', 'xlarge'] | |
ext.densityCodes = ['ldpi': 1, 'mdpi': 2, 'hdpi': 3, 'xhdpi': 4, 'xxhdpi': 5, 'xxxhdpi': 6] | |
android.applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def baseDensityVersionCode = project.ext.densityCodes.get(output.getFilter("DENSITY")) | |
if (baseDensityVersionCode == null) { baseDensityVersionCode = 0 } | |
output.versionCodeOverride = android.defaultConfig.versionCode * 10 + baseDensityVersionCode | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment