#1219 support densit splits

This commit is contained in:
Sean Mac Gillicuddy 2019-06-24 17:27:08 +01:00
parent f1dcc82103
commit 3c3d1ce1cf
2 changed files with 17 additions and 14 deletions

View File

@ -197,15 +197,17 @@ private String generateVersionName() {
} }
/* /*
* max version code: 210-0-00-00-00 * max version code: 21-0-0-00-00-00
* our template : UUU-A-ZZ-YY-XX * our template : UU-D-A-ZZ-YY-XX
* where: * where:
* X = patch version * X = patch version
* Y = minor version * Y = minor version
* Z = major version (+ 20 to distinguish from previous, non semantic, versions of the app) * Z = major version (+ 20 to distinguish from previous, non semantic, versions of the app)
* A = number representing ABI split * A = number representing ABI split
* D = number representing density split
* U = unused * U = unused
*/ */
private Integer generateVersionCode() { private Integer generateVersionCode() {
20 * 10000 + 20 * 10000 +
(ext.versionMajor * 10000) + (ext.versionMajor * 10000) +
@ -444,20 +446,28 @@ android {
} }
def abiCodes = ['arm64-v8a': 6, 'x86': 3, 'x86_64': 4, 'armeabi-v7a': 5] def abiCodes = ['arm64-v8a': 6, 'x86': 3, 'x86_64': 4, 'armeabi-v7a': 5]
def densityCodes = ['mdpi': 2, 'hdpi': 3, 'xhdpi': 4, 'xxhdpi': 5, 'xxxhdpi': 6]
splits { splits {
abi { abi {
enable true enable true
reset() reset()
include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a" include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a"
universalApk buildNumber == "dev" universalApk true
}
density {
enable true
reset()
include "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"
} }
} }
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.each { output -> variant.outputs.each { output ->
def baseAbiVersionCode = abiCodes.get(output.getFilter(OutputFile.ABI)) def baseAbiVersionCode = abiCodes.get(output.getFilter(OutputFile.ABI)) ?: 0
if (baseAbiVersionCode != null) { def baseDensityVersionCode = densityCodes.get(output.getFilter(OutputFile.ABI)) ?: 1
output.versionCodeOverride = baseAbiVersionCode * 1000000 + variant.versionCode output.versionCodeOverride =
} (baseDensityVersionCode * 10000000) +
(baseAbiVersionCode * 1000000) +
variant.versionCode
} }
} }
} }

View File

@ -3,13 +3,6 @@
android:installLocation="auto" android:installLocation="auto"
package="org.kiwix.kiwixmobile"> package="org.kiwix.kiwixmobile">
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>