-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathbuild.gradle
401 lines (359 loc) · 16.9 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
buildscript {
repositories {
mavenCentral()
}
dependencies {
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Release]")) {
println("Enabling New Relic")
// classpath "com.newrelic.agent.android:agent-gradle-plugin:5.27.1"
}
}
}
apply plugin: 'com.android.application'
//apply from: 'token-replace.gradle'
apply from: '../common.gradle'
apply plugin: 'kotlin-android'
if (project.file('local.gradle').exists()) {
apply from: 'local.gradle'
}
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Release]")) {
/* apply plugin: 'newrelic'
newrelic {
variantMapsEnabled false
uploadMapsForVariant ''
}*/
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
}
repositories {
maven {
url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/"
}
maven {
url "https://jitpack.io"
}
flatDir {
dirs project(':app').file('libs'), project(':wear').file('libs')
}
}
/**
* Reads a property from the project settings (Gradle properties), the system environment or
* from the file <code>local.properties</code>.
*
* @param propertyName the name of the property to read
* @return the property value or an empty string
*/
def getLocalProperty(String propertyName) {
def propVal = project.findProperty(propertyName)
if (propVal == null) {
propVal = System.getenv(propertyName)
if (propVal == null)
propVal = System.getenv(propertyName.toLowerCase())
if (propVal == null)
propVal = System.getenv(propertyName.toUpperCase())
if (propVal == null) {
def propsFile = rootProject.file('local.properties')
if (propsFile.exists()) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
propVal = props[propertyName]
} else {
propVal = ""
}
}
}
return propVal
}
android {
compileSdk 34
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == "com.android.databinding") {
// changes to databinding libraries can apparently result in nasty bugs on some handsets
// the following checks that databinding dependencies are not changed from the tested configuration
// 2.3.0 and 1.3.1 are from me.tatarka.bindingcollectionadapter2
if (!["3.1.4", "2.3.0", "1.3.1", "3.4.3", "3.6.4", "7.4.2"].contains(details.target.version)) {
throw new GradleException("Untested databinding version: " + details.requested.group + " " + details.requested.name + "- " + details.requested.version + " - " + details.target.version)
}
}
}
}
defaultConfig {
applicationId "com.eveningoutpost.dexdrip"
minSdkVersion 24
// increasing target SDK version can cause compatibility issues with Android 7+
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 24
// change versionCode only when downgrade should be prevented
// eg, when data structures are incompatible
versionCode 1603091400
versionName generateVersionName()
buildConfigField "int", "buildVersion", generateVersionNumberString()
buildConfigField "String", "buildUUID", generateRandomUUID()
buildConfigField "long", "buildTimestamp", generateTimestamp()
buildConfigField "int", "targetSDK", targetSdkVersion.mApiLevel.toString()
//vectorDrawables.useSupportLibrary = true // broken in newer gradle versions
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled false
// To get a Google Maps API key, follow this link, follow the directions and press "Create" at the end:
// https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=7C:1E:BB:15:CE:A1:92:30:47:9D:D0:3D:89:F6:C6:51:7D:3C:1B:DD%3Bcom.eveningoutpost.dexdrip
manifestPlaceholders = [google_maps_key:getLocalProperty('google_maps_key'),
'appAuthRedirectScheme': 'xdrip'
]
}
// The defaultConfig values above are fixed, so your incremental builds don't
// need to rebuild the manifest (and therefore the whole APK, slowing build times).
// But for release builds, it's okay. So the following script iterates through
// all the known variants, finds those that are "release" build types, and
// changes those properties to something dynamic.
applicationVariants.all { variant ->
if (variant.buildType.name == "release") {
variant.outputs.each { output ->
output.versionNameOverride = generateVersionName()
}
}
}
testOptions {
animationsDisabled = true
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
lintOptions {
checkReleaseBuilds false
disable 'MissingTranslation'
disable 'ExtraTranslation'
}
configurations {
all {
exclude group: 'commons-logging', module: 'commons-logging'
exclude group: 'org.apache.httpcomponents'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/LICENSE.md'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'org/apache/http/version.properties'
exclude 'org/apache/http/client/version.properties'
//exclude 'META-INF/androidx.core_core.version'
exclude 'META-INF/com.android.tools/proguard/coroutines.pro'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/androidx.interpolator_interpolator.version'
exclude 'META-INF/androidx.core_core.version'
pickFirst 'org/bouncycastle/x509/CertPathReviewerMessages.properties'
pickFirst 'org/bouncycastle/x509/CertPathReviewerMessages_de.properties'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
testProguardFile 'proguard-debug.pro'
multiDexKeepProguard file('proguard-debug.pro')
ext.enableCrashlytics = false
// applicationIdSuffix ".debug"
versionNameSuffix "-debug"
debuggable true
}
dev {
minifyEnabled false
shrinkResources false
ext.enableCrashlytics = false
ext.alwaysUpdateBuildId = false
versionNameSuffix "-debug"
debuggable true
signingConfig debug.signingConfig
matchingFallbacks = ['debug', 'release']
}
}
flavorDimensions "version"
productFlavors {
// When building a variant that uses this flavor, the following configurations
// override those in the defaultConfig block.
fast {
// To avoid using legacy multidex when building from the command line,
// set minSdkVersion to 21 or higher. When using Android Studio 2.3 or higher,
// the build automatically avoids legacy multidex when deploying to a device running
// API level 21 or higher—regardless of what you set as your minSdkVersion.
minSdkVersion 24
versionNameSuffix "-dev"
buildConfigField "int", "buildVersion", "2021010100"
buildConfigField "String", "buildUUID", "\"0f79a60a-5616-99be-8eb1-a430edcfd9fd\""
buildConfigField "long", "buildTimestamp", "1609459200L"
resConfigs "en", "xxhdpi"
}
prod {
// If you've configured the defaultConfig block for the release version of
// your app, you can leave this block empty and Gradle uses configurations in
// the defaultConfig block instead. You still need to create this flavor.
// Otherwise, all variants use the "dev" flavor configurations.
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
wearApp project(':wear')
//weapApp files('../wear/build/outputs/apk/wear_release.apk')
//testimplementation 'com.squareup.okhttp:mockwebserver:2.5.0'
implementation('com.github.nightscout:android-uploader:CORE_FOR_XDRIP') {
transitive = false
}
implementation project(':localeapi')
implementation project(':libkeks')
// add missing JAXB dependencies for JDK 9+
if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_1_9.ordinal()) {
annotationProcessor 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
annotationProcessor 'org.glassfish.jaxb:jaxb-runtime:2.3.5'
}
// app auth implementation
//implementation(name: 'core-1.1.0', ext: 'aar')
implementation(name: 'appauth-release', ext: 'aar') {
exclude group: 'androidx.core', module: 'core' // fix INotificationSideChannel // android.support.v4.app
}
implementation("androidx.browser:browser:1.3.0") {
exclude group: 'androidx.core', module: 'core' // fix INotificationSideChannel // android.support.v4.app
}
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1"
implementation(name: 'ns-sdk-full-release', ext: 'aar')
//implementation 'androidx.core:core-ktx:1.9.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.22'
implementation ('androidx.appcompat:appcompat:1.0.0')
implementation ('com.google.android.material:material:1.1.0')
implementation ('androidx.legacy:legacy-support-v13:1.0.0')
implementation ('androidx.recyclerview:recyclerview:1.0.0')
implementation ('androidx.cardview:cardview:1.0.0')
implementation ('androidx.preference:preference:1.0.0')
implementation ('com.google.apis:google-api-services-drive:v3-rev20220815-2.0.0') {
exclude group: 'org.apache.httpcomponents'
}
implementation 'com.google.api-client:google-api-client-android:1.26.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
// implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-wearable:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation "com.google.android.gms:play-services-gcm:15.0.0"
implementation "com.google.android.gms:play-services-oss-licenses:15.0.0"
implementation 'com.squareup.wire:wire-runtime:2.2.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.13'
implementation "com.newrelic.agent.android:android-agent:5.27.1"
//implementation 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
implementation 'com.squareup.moshi:moshi:1.9.2'
//implementation 'org.influxdb:influxdb-java:2.6'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
implementation 'com.getpebble:pebblekit:3.1.0'
implementation ("androidx.health.connect:connect-client:1.1.0-alpha06") {
exclude group: 'androidx.core', module: 'core'
}
implementation 'com.github.jamorham:amazfitcommunication:master-SNAPSHOT'
implementation 'io.reactivex:rxjava:1.3.3'
implementation "com.polidea.rxandroidble2:rxandroidble:1.12.1"
implementation 'com.google.guava:guava:24.1-android'
implementation 'com.embarkmobile:zxing-android-minimal:2.0.0@aar'
implementation 'com.embarkmobile:zxing-android-integration:2.0.0@aar'
//implementation 'com.embarkmobile:zxing-android-legacy:2.0.0@aar'
implementation 'com.google.zxing:core:3.5.1'
implementation 'net.tribe7.seeds:seeds-functional:16.0.1'
implementation 'net.tribe7.seeds:seeds-primitives:16.0.1'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter:2.2.0'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-recyclerview:2.2.0'
implementation 'org.slf4j:slf4j-api:1.7.7'
implementation 'org.apache.commons:commons-math3:3.6'
implementation 'uk.com.robust-it:cloning:1.9.5'
implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
// implementation 'com.itextpdf:itextg:5.5.9'
implementation 'com.github.jamorham:QR-Code-generator:d0454644af'
// Pebble-Trend, needs to be checked if really needed
//implementation 'com.android.support:multidex:1.0.1'
implementation 'ar.com.hjg:pngj:2.1.0'
//implementation 'com.bugfender.sdk:android:0.+'
// implementation 'com.rarepebble:colorpicker:1.7.0'
implementation(name: 'thread-safe-active-android-3.1.1', ext: 'aar')
implementation(name: 'colorpicker', ext: 'aar')
implementation(name: 'hellocharts-library-release', ext: 'aar')
implementation(name: 'search-preference', ext: 'aar')
implementation 'org.apache.commons:commons-text:1.3'
implementation 'com.google.dagger:dagger:2.25.4'
implementation "com.evernote:android-job:1.2.6"
//implementation 'com.android.support:multidex:1.0.3'
//implementation 'com.google.dagger:dagger-android-support:2.x' // if you use the support libraries
annotationProcessor 'com.google.dagger:dagger-compiler:2.25.4'
implementation 'net.danlew:android.joda:2.10.6.1'
implementation 'org.bouncycastle:bcpkix-jdk15to18:1.68'
def appCenterSdkVersion = '4.4.5'
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
testImplementation 'joda-time:joda-time:2.10.7'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.objenesis:objenesis:2.5.1'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation "org.robolectric:robolectric:4.11.1"
testImplementation "com.google.truth:truth:1.1.3"
testImplementation 'org.mockito:mockito-inline:2.13.0'
testImplementation 'org.mockito:mockito-core:4.11.0'
testImplementation 'org.powermock:powermock-core:1.7.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1'
testImplementation 'org.powermock:powermock-module-junit4-rule:1.7.1'
testImplementation 'org.powermock:powermock-classloading-xstream:1.7.1'
testImplementation 'org.powermock:powermock-api-mockito2:1.7.1'
androidTestImplementation(name: 'barista-1.7.0', ext: 'aar') {
exclude group: 'com.android.support'
}
// espresso, workarounds needed for correct functioning
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'androidx.test.ext:junit:1.1.5', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.1.0'
// add this for intent mocking support
//androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.1'
// add this for webview testing support
//androidTestImplementation 'com.android.support.test.espresso:espresso-web:3.0.1'
// you will want to install the android studio lombok plugin
compileOnly 'org.projectlombok:lombok'
annotationProcessor "org.projectlombok:lombok"
// use lombok in unit tests
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "started", "skipped", "passed", "failed"
showStandardStreams true
}
}
apply plugin: 'com.google.gms.google-services'