Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build.gradle « app - github.com/nextcloud/talk-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a14889adf85379ca8e9a16e3512aa9f819eb45db (plain)
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
/*
 * Nextcloud Talk application
 *
 * @author Mario Danic
 * @author Andy Scherzinger
 * @author Marcel Hibbe
 * @author Tim Krüger
 * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
 * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
 * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
 * Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
import com.github.spotbugs.snom.SpotBugsTask
import com.nextcloud.talk.gradle.DownloadWebRtcTask

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.spotbugs'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: 'kotlinx-serialization'

android {
    compileSdkVersion 31
    buildToolsVersion '33.0.0'

    namespace 'com.nextcloud.talk'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 31
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        // mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable)
        // xx   .xxx  .xx    .xx
        versionCode 150010006
        versionName "15.1.0 Alpha 06"

        flavorDimensions "default"
        renderscriptTargetApi 19
        renderscriptSupportModeEnabled true

        productFlavors {
            // used for f-droid
            generic {
                applicationId 'com.nextcloud.talk2'
                dimension "default"
            }
            gplay {
                applicationId 'com.nextcloud.talk2'
                dimension "default"
            }
            qa {
                applicationId "com.nextcloud.talk2.qa"
                dimension "default"
                versionCode 1
                versionName "1"
            }
        }

        // Enabling multidex support.
        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true

        lintOptions {
            disable 'InvalidPackage'
            disable 'MissingTranslation'
            disable 'VectorPath'
            disable 'UnusedQuantity'
        }

        javaCompileOptions {
            annotationProcessorOptions {
                arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }

        testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
        testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
        testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"

        def localBroadcastPermission = "PRIVATE_BROADCAST"
        manifestPlaceholders.broadcastPermission = localBroadcastPermission
        buildConfigField "String", "PERMISSION_LOCAL_BROADCAST", "\"${localBroadcastPermission}\""
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        resources {
            excludes += [
                'META-INF/LICENSE.txt',
                'META-INF/LICENSE',
                'META-INF/NOTICE.txt',
                'META-INF/NOTICE',
                'META-INF/DEPENDENCIES',
                'META-INF/rxjava.properties'
            ]
        }
    }

    check.dependsOn 'spotbugsGplayDebug', 'lint', 'ktlintCheck', 'detekt'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildFeatures {
        viewBinding true
    }

    lint {
        abortOnError false
        disable 'MissingTranslation','PrivateResource'
        htmlOutput file("$project.buildDir/reports/lint/lint.html")
        htmlReport true
    }
}

ext {
    androidxCameraVersion = "1.1.0"
    coilKtVersion = "2.2.2"
    daggerVersion = "2.44"
    lifecycleVersion = '2.5.1'
    okhttpVersion = "4.10.0"
    materialDialogsVersion = "3.3.0"
    parcelerVersion = "1.1.13"
    retrofit2Version = "2.9.0"
    roomVersion = "2.4.3"
    workVersion = "2.7.1"
    markwonVersion = "4.6.2"
    espressoVersion = "3.4.0"
}

def webRtcVersion = "96.4664.0"
tasks.register('downloadWebRtc', DownloadWebRtcTask){
    version = webRtcVersion
}

preBuild.dependsOn('downloadWebRtc')

configurations.all {
    exclude group: 'com.google.firebase', module: 'firebase-core'
    exclude group: 'com.google.firebase', module: 'firebase-analytics'
    exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
}

dependencies {
    detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0")
	
    implementation fileTree(include: ['*'], dir: 'libs')

    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0"

    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation "com.vanniktech:emoji-google:0.15.0"
    implementation group: 'androidx.emoji', name: 'emoji-bundled', version: '1.1.0'
    implementation 'org.michaelevans.colorart:library:0.0.3'
    implementation "androidx.work:work-runtime:${workVersion}"
    implementation "androidx.work:work-rxjava2:${workVersion}"
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
    androidTestImplementation "androidx.work:work-testing:${workVersion}"
    implementation 'com.google.android:flexbox:2.0.1'
    implementation ('com.gitlab.bitfireAT:dav4jvm:2.1.3', {
        exclude group: 'org.ogce', module: 'xpp3'	// Android comes with its own XmlPullParser
    })
    implementation 'org.conscrypt:conscrypt-android:2.5.2'

    implementation "androidx.camera:camera-core:${androidxCameraVersion}"
    implementation "androidx.camera:camera-camera2:${androidxCameraVersion}"
    implementation "androidx.camera:camera-lifecycle:${androidxCameraVersion}"
    implementation "androidx.camera:camera-view:${androidxCameraVersion}"
    implementation "androidx.exifinterface:exifinterface:1.3.4"

    implementation "androidx.lifecycle:lifecycle-runtime-ktx:${lifecycleVersion}"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:${lifecycleVersion}"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${lifecycleVersion}"

    implementation 'androidx.biometric:biometric:1.1.0'

    implementation 'androidx.multidex:multidex:2.0.1'

    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation "io.reactivex.rxjava2:rxjava:2.2.21"

    implementation 'com.bluelinelabs:conductor:3.1.7'

    implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
    implementation "com.squareup.okhttp3:okhttp-urlconnection:${okhttpVersion}"
    implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"

    implementation 'com.bluelinelabs:logansquare:1.3.7'
    implementation 'com.fasterxml.jackson.core:jackson-core:2.13.4'
    kapt 'com.bluelinelabs:logansquare-compiler:1.3.7'

    implementation "com.squareup.retrofit2:retrofit:${retrofit2Version}"
    implementation "com.squareup.retrofit2:adapter-rxjava2:${retrofit2Version}"
    implementation 'com.github.aurae.retrofit2:converter-logansquare:1.4.1'

    implementation "com.google.dagger:dagger:${daggerVersion}"
    kapt "com.google.dagger:dagger-compiler:${daggerVersion}"
    implementation 'com.github.lukaspili.autodagger2:autodagger2:1.1'
    kapt 'com.github.lukaspili.autodagger2:autodagger2-compiler:1.1'
    compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
    // Android only
    implementation 'org.greenrobot:eventbus:3.3.1'
    implementation 'net.zetetic:android-database-sqlcipher:4.5.2'

    implementation "androidx.room:room-runtime:${roomVersion}"
    implementation "androidx.room:room-rxjava2:${roomVersion}"
    kapt "androidx.room:room-compiler:${roomVersion}"
    implementation "androidx.room:room-ktx:${roomVersion}"

    implementation "org.parceler:parceler-api:$parcelerVersion"
    implementation 'net.orange-box.storebox:storebox-lib:1.4.0'
    implementation 'eu.davidea:flexible-adapter:5.1.0'
    implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
    implementation fileTree(downloadWebRtc.libFile.path)
    implementation 'com.yarolegovich:mp:1.1.6'
    implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0'
    implementation 'org.apache.commons:commons-lang3:3.12.0'
    implementation 'com.github.wooplr:Spotlight:1.3'
    implementation 'com.google.code.findbugs:jsr305:3.0.2'
    implementation('com.github.nextcloud-deps:ChatKit:0.3.0-1', {
        exclude group: 'com.facebook.fresco'
    })

    implementation 'com.github.nextcloud-deps.fresco:fresco:v111'
    implementation 'com.github.nextcloud-deps.fresco:animated-webp:v111'
    implementation 'com.github.nextcloud-deps.fresco:webpsupport:v111'
    implementation 'com.github.nextcloud-deps.fresco:animated-gif:v111'
    implementation 'com.github.nextcloud-deps.fresco:imagepipeline-okhttp3:v111'
    implementation 'joda-time:joda-time:2.12.0'
    implementation "io.coil-kt:coil:${coilKtVersion}"
    implementation "io.coil-kt:coil-gif:${coilKtVersion}"
    implementation "io.coil-kt:coil-svg:${coilKtVersion}"
    implementation 'com.github.natario1:Autocomplete:v1.1.0'

    implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.4.5'

    implementation 'com.novoda:merlin:1.2.1'

    implementation 'com.github.nextcloud:PopupBubble:2.0.0'
    implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'

    implementation "com.afollestad.material-dialogs:core:${materialDialogsVersion}"
    implementation "com.afollestad.material-dialogs:datetime:${materialDialogsVersion}"
    implementation "com.afollestad.material-dialogs:bottomsheets:${materialDialogsVersion}"
    implementation "com.afollestad.material-dialogs:lifecycle:${materialDialogsVersion}"

    implementation 'com.google.code.gson:gson:2.9.1'
    implementation 'com.google.android.exoplayer:exoplayer:2.18.1'

    implementation 'com.github.chrisbanes:PhotoView:2.3.0'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.25'

    implementation "io.noties.markwon:core:$markwonVersion"

    //implementation 'com.github.dhaval2404:imagepicker:1.8'
    implementation 'com.github.nextcloud-deps:ImagePicker:1.8.0.2'
    implementation 'com.elyeproj.libraries:loaderviewlibrary:2.0.0'

    implementation 'org.osmdroid:osmdroid-android:6.1.14'
    implementation ('fr.dudie:nominatim-api:3.4', {
        //noinspection DuplicatePlatformClasses
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    })

    implementation 'androidx.core:core-ktx:1.8.0'

    testImplementation 'junit:junit:4.13.2'
    testImplementation 'org.mockito:mockito-core:4.8.0'

    androidTestImplementation "androidx.test:core:1.4.0"

    // Espresso core
    androidTestImplementation ("androidx.test.espresso:espresso-core:$espressoVersion", {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
    androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion"
    androidTestImplementation "androidx.test.espresso:espresso-accessibility:$espressoVersion"
    androidTestImplementation('com.android.support.test.espresso:espresso-intents:3.0.2')

    spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
    spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'

    gplayImplementation 'com.google.android.gms:play-services-base:18.1.0'
    gplayImplementation "com.google.firebase:firebase-messaging:23.1.0"

    // implementation 'androidx.activity:activity-ktx:1.4.0'

    implementation 'com.github.nextcloud.android-common:ui:0.1.0'
}

task installGitHooks(type: Copy, group: "development") {
    description = "Install git hooks"
    from("../scripts/hooks") {
        include '*'
    }
    into '../.git/hooks'
}

spotbugs {
    ignoreFailures = true // should continue checking
    effort = "max"
    reportLevel = "medium"
}

tasks.withType(SpotBugsTask) { task ->
    String variantNameCap = task.name.replace("spotbugs", "")
    String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1)

    dependsOn "compile${variantNameCap}Sources"

    excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
    classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
    reports {
        xml {
            required = true
        }
        html {
            required = true
            outputLocation = file("$project.buildDir/reports/spotbugs/spotbugs.html")
            stylesheet = 'fancy.xsl'
        }
    }
}

tasks.named("detekt").configure {
    reports {
        html.required.set(true)
        txt.required.set(true)
        xml.required.set(false)
        sarif.required.set(false)
        md.required.set(false)
    }
}

detekt {
    config = files("../detekt.yml")
    input = files("src/")
}