forked from guardianproject/orbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commons-device.gradle
70 lines (61 loc) · 1.91 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Applies across android app modules: {app, app-mini, 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
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
splits {
abi {
enable true
reset()
include "x86", "armeabi-v7a", "x86_64", "arm64-v8a"
}
}
packagingOptions {
exclude 'META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version'
}
}
repositories {
//noinspection JcenterRepositoryObsolete
jcenter {
content {
includeGroup('com.jraska')
includeGroup('tools.fastlane')
}
}
}