forked from metrodroid/metrodroid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
234 lines (208 loc) · 6.91 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
allprojects {
repositories {
google()
jcenter()
}
}
buildscript {
ext {
kotlin_version = '1.3.11'
lint_version = '26.2.1'
support_version = '28.0.0'
android_test_version = '1.1.0'
hamcrest_version = '1.3'
build_version = '28.0.3'
android_sdk_version = 28
android_min_version = 16
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.protobuf'
apply plugin: 'checkstyle'
apply plugin: 'kotlin-android-extensions'
/*
check.dependsOn 'checkstyle'
task checkstyle(type: Checkstyle) {
source 'src'
include '** /*.java'
exclude '** /gen/**'
classpath = files()
}
*/
dependencies {
implementation ("com.android.support:appcompat-v7:$support_version") {
exclude module: 'animated-vector-drawable'
exclude module: 'support-fragment'
}
implementation "com.android.support:cardview-v7:$support_version"
implementation "com.android.support:support-annotations:$support_version"
implementation "com.android.support:support-core-ui:$support_version"
implementation ("com.android.support:support-core-utils:$support_version") {
exclude module: 'support-compat'
}
implementation "com.android.support:support-vector-drawable:$support_version"
implementation 'commons-io:commons-io:2.5'
implementation 'org.apache.commons:commons-lang3:3.5'
implementation 'com.google.protobuf:protobuf-lite:3.0.0'
implementation 'com.neovisionaries:nv-i18n:1.23'
implementation('org.simpleframework:simple-xml:2.7.1') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
}
implementation project(':leaflet')
implementation project(':material-design-icons')
implementation 'com.github.bmelnychuk:atv:1.2.9'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
androidTestUtil "androidx.test:orchestrator:$android_test_version"
androidTestImplementation "androidx.test:rules:$android_test_version"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation "androidx.test.ext:junit:1.0.0"
androidTestImplementation "org.hamcrest:hamcrest-core:$hamcrest_version"
androidTestImplementation "org.hamcrest:hamcrest-library:$hamcrest_version"
lintChecks project(':lintchecks')
}
protobuf {
protoc {
// You still need protoc like in the non-Android case
artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
javalite {
// The codegen for lite comes as a separate artifact
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
// In most cases you don't need the full Java output
// if you use the lite output.
remove java
}
task.plugins {
javalite { }
}
}
}
}
task copyThirdPartyNotices(type: Copy) {
from 'third_party/'
into 'build/assets/third_party'
eachFile { it.path = name }
include 'NOTICE.**.txt'
}
android {
compileSdkVersion android_sdk_version
buildToolsVersion build_version
defaultConfig {
minSdkVersion android_min_version
targetSdkVersion android_sdk_version
testApplicationId "au.id.micolous.farebot.test"
versionCode "git -C ${projectDir} rev-list --count HEAD".execute().text.trim().toInteger()
versionName "git -C ${projectDir} describe --always --tags --dirty".execute().text.trim().replaceAll("^v", "")
resConfigs ([
// Update this whenever new language translations become available in Weblate.
// Languages we support
'en', 'en-rAU', 'en-rCA', 'en-rGB', 'en-rIE', 'en-rIN', 'en-rNZ', 'en-rUS',
'de',
'es',
'fi',
'fr',
'ga',
// Hebrew
'he', 'iw',
// Indonesian
'id', 'in',
'ja',
'kab',
'nb-rNO',
'nl',
'ru',
'tr',
'zh-rCN',
'zh-rHK',
'zh-rSG',
'zh-rTW',
// UI mode
])
vectorDrawables {
useSupportLibrary = true
generatedDensities 'ldpi', 'mdpi', 'hdpi'
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// The following argument makes the Android Test Orchestrator run its
// "pm clear" command after each test invocation. This command ensures
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'
}
buildTypes {
debug {
pseudoLocalesEnabled true
}
dev.initWith(buildTypes.debug)
dev {
applicationIdSuffix '.dev'
minifyEnabled true
shrinkResources true
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard.cfg'
matchingFallbacks = ['debug']
}
release {
minifyEnabled true
shrinkResources true
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard.cfg'
}
}
applicationVariants.all { variant ->
if (variant.buildType.name.equals("debug")) {
variant.mergedFlavor.resourceConfigurations.add("en-rXA")
variant.mergedFlavor.resourceConfigurations.add("ar-rXB")
}
}
preBuild.dependsOn copyThirdPartyNotices
sourceSets {
androidTest.assets.srcDirs += [
'third_party/vpereira_bilhete/',
'third_party/RejsekortReader/dumps/'
]
main.assets.srcDirs += ['build/assets']
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
}
androidExtensions {
// Needed for kotlinx.android.parcel.Parcelize
experimental = true
}
repositories {
mavenCentral()
}