-
-
Notifications
You must be signed in to change notification settings - Fork 339
/
commons-device.gradle
52 lines (45 loc) · 1.52 KB
/
commons-device.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Applies across android app modules: {app, app-tv}
*/
apply plugin: 'com.android.application'
apply from: "../commons.gradle"
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.canRead()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
//Increments versionCode by ABI type
def abiCodeMap = ['armeabi-v7a': '1', 'arm64-v8a': '2', 'x86': '4', 'x86_64': '5']
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def baseVersionCode = abiCodeMap.get(output.getFilter("ABI"))
if(baseVersionCode != null) {
output.versionCodeOverride = Integer.valueOf(variant.versionCode) + Integer.valueOf(baseVersionCode)
}
}
}
android {
signingConfigs {
release {
if (!keystoreProperties.stringPropertyNames().isEmpty()) {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
splits {
abi {
enable true
reset()
include "x86", "armeabi-v7a", "x86_64", "arm64-v8a"
}
}
}