This repository has been archived by the owner on Aug 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
186 lines (167 loc) · 7.31 KB
/
build.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
apply plugin: 'org.sonarqube'
// Top-level build file where you can add configuration options common to all sub-projects/modules
buildscript {
ext.kotlin_version = '1.2.61'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath 'com.google.gms:google-services:3.2.1'
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:3.0.0"
}
// use our modified version above.
configurations {
androidTestImplementation.exclude group: 'com.android.support', module: 'support-v4'
}
}
ext {
revision = getGitCommitHash()
versionRevision = getGitCommitCount()
logger.info("Revision ${revision}")
logger.info("Version revision ${versionRevision}")
appVersionCode = getVersionCode(ext.versionRevision)
appVersionNameDE = "5.15.0"
appVersionNameIT = "2.13.0"
appVersionNameMX = "3.13.0"
appVersionNameUS = "3.4.0"
appVersionNameAT = "1.0.0"
buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"))
isJenkins = System.getenv("JENKINS_HOME") != null
// override this with -PsendExternalPartners=true to inform external-testers about new version
sendExternalPartners = project.hasProperty("sendExternalPartners") ? sendExternalPartners.toBoolean() : false
// override this with -PisProduction=true to create publishable release builds
isProduction = project.hasProperty("isProduction") ? isProduction.toBoolean() : false
// override this with -PisBeta=true to enable debug screen in production build without environment switcher
isBeta = project.hasProperty("isBeta") ? isBeta.toBoolean() : false
// override this with -PisProximityActivated=true to create publishable release builds
isProximityActivated = project.hasProperty("isProximityActivated") ? isProximityActivated.toBoolean() : true
//for releases without proximity change this default value to false
versions = [
android: [
buildTools : '28.0.3',
compileSdk : 28,
javaVersion: JavaVersion.VERSION_1_8,
minSdk : 16,
targetSdk : 28
],
libs : [
adition : '25',
adjust : '4.11.4',
taptargetview : '1.9.1',
androidanimations : '2.3',
androidMapsUtils : '0.5+',
butterknife : '8.8.1',
checkstyle : '8.4',
commonsCollections4 : '4.1',
conceal : '1.1.3',
confetti : '1.1.0',
constraintLayout : '1.0.2',
crashlytics : '2.7.1',
cupboard : '2.2.0',
cupboardTools : '0.3.1',
sqlCipher : '3.5.7',
dagger : '2.16',
easing : '2.1',
eventbus : '2.4.0',
playServices : '16.0.0',
glide : '4.6.1',
gson : '2.8.2',
joda : '2.9.9',
jodaConvert : '1.9.2',
jsr250 : '1.0',
ktlint : '0.12.1',
leakcanary : '1.5.4',
libphonenumber : '8.8.5',
materialprogressbar : '1.4.2',
multidex : '1.0.3',
okhttp3 : '3.9.0',
omniture : '4.13.7',
pageindicatorview : '0.2.0',
retrofit : '2.3.0',
rxandroid2 : '2.1.0',
rxbinding : '2.0.0',
rxcupboard2 : '2.0',
rxjava2 : '2.1.6',
securePreferences : '1.0',
support : '28.0.0',
androidArchitecture : '1.1.1',
androidArchitectureRuntime: '1.0.3',
timber : '4.7.0',
umtcore : '0.67',
umtsdk : '0.67',
umtnfc : '1.4',
validationKomensky : '0.9.2',
zxing : '3.3.0',
// Only for test
dexmaker : '2.2.0',
junit : '4.12',
mockito : '2.3.0',
robolectric : '3.4-rc3',
robolectricShadows : '3.4-rc3',
]
]
configurations.all {
resolutionStrategy {
force "com.android.support:support-annotations:" + versions.libs.support,
"com.android.support:appcompat-v7:" + versions.libs.support,
"com.android.support:support-v4:" + versions.libs.support
}
}
}
allprojects {
// prevent evil gradle children fork processes spawns from stealing focus
tasks.withType(JavaForkOptions) {
// Forked processes like GradleWorkerMain for tests won't steal focus!
jvmArgs '-Djava.awt.headless=true'
}
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
}
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
}
subprojects {
tasks.withType(Test).all {
ignoreFailures isJenkins
systemProperty "run-under-test", "true"
}
}
private static def getGitCommitCount() {
try {
return 'git rev-list --first-parent --count HEAD'.execute().text.trim() as Integer
}
catch (ignored) {
return 0
}
}
private static def getGitCommitHash() {
try {
return 'git rev-parse --short HEAD'.execute().text.trim()
}
catch (ignored) {
return null
}
}
private static def getVersionCode(rev) {
//magic number bcs it was mistakenly changed to max code of DE and applied to all countries now we use it everywhere
return 680040000 + rev
}
private def getVersionName(appVersionMajor, appVersionMinor, appVersionPatch) {
return "${appVersionMajor}.${appVersionMinor}.${appVersionPatch}";
}