2024-03-29 18:56:51 +03:00
|
|
|
/*
|
|
|
|
* Nextcloud - Android Client
|
|
|
|
*
|
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
2024-06-03 17:40:29 +03:00
|
|
|
* SPDX-FileCopyrightText: 2024 Alper Ozturk <alper.ozturk@nextcloud.com>
|
2024-03-29 18:56:51 +03:00
|
|
|
* SPDX-FileCopyrightText: 2024 Tobias Kaminsky <tobias@kaminsky.me>
|
|
|
|
* SPDX-FileCopyrightText: 2024 Andy Scherzinger <info@andy-scherzinger.de>
|
2024-04-08 14:49:07 +03:00
|
|
|
* SPDX-FileCopyrightText: 2022 Álvaro Brey Vilas <alvaro@alvarobrey.com>
|
2024-04-30 13:16:39 +03:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
2024-03-29 18:56:51 +03:00
|
|
|
*/
|
2024-01-29 14:35:23 +03:00
|
|
|
import com.github.spotbugs.snom.Confidence
|
|
|
|
import com.github.spotbugs.snom.Effort
|
2024-02-22 12:13:22 +03:00
|
|
|
import com.github.spotbugs.snom.SpotBugsTask
|
2022-03-11 13:10:51 +03:00
|
|
|
import org.gradle.internal.jvm.Jvm
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
dependencies {
|
2023-01-30 09:52:31 +03:00
|
|
|
classpath "com.android.tools.build:gradle:$androidPluginVersion"
|
2024-11-05 14:16:35 +03:00
|
|
|
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.26'
|
2022-03-11 13:10:51 +03:00
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
2024-09-08 20:00:55 +03:00
|
|
|
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.7"
|
2022-03-11 13:10:51 +03:00
|
|
|
classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
|
2024-02-14 17:23:36 +03:00
|
|
|
classpath 'com.karumi:shot:6.1.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
|
|
|
|
classpath "org.jacoco:org.jacoco.report:$jacoco_version"
|
|
|
|
classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-07 18:42:29 +03:00
|
|
|
plugins {
|
2024-11-29 21:06:22 +03:00
|
|
|
id "org.jetbrains.kotlin.plugin.compose" version "2.1.0"
|
2024-06-27 13:49:57 +03:00
|
|
|
id "com.diffplug.spotless" version "6.25.0"
|
2024-11-29 21:03:44 +03:00
|
|
|
id "org.jetbrains.kotlin.kapt" version "2.1.0"
|
2024-11-28 05:02:34 +03:00
|
|
|
id 'com.google.devtools.ksp' version '2.1.0-1.0.29' apply false
|
2022-10-07 18:42:29 +03:00
|
|
|
}
|
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
apply plugin: 'kotlin-parcelize'
|
|
|
|
apply plugin: 'checkstyle'
|
|
|
|
apply plugin: 'pmd'
|
2023-05-08 20:06:33 +03:00
|
|
|
apply from: "$rootProject.projectDir/jacoco.gradle"
|
2022-03-11 13:10:51 +03:00
|
|
|
apply plugin: 'com.github.spotbugs'
|
|
|
|
apply plugin: 'io.gitlab.arturbosch.detekt'
|
2024-02-22 12:13:22 +03:00
|
|
|
|
|
|
|
// needed to make renovate run without shot, as shot requires Android SDK
|
|
|
|
// https://github.com/pedrovgs/Shot/issues/300
|
|
|
|
if (shotTest) {
|
|
|
|
apply plugin: 'shot'
|
|
|
|
}
|
2023-08-29 10:08:39 +03:00
|
|
|
apply plugin: 'com.google.devtools.ksp'
|
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
|
|
|
|
println "Gradle uses Java ${Jvm.current()}"
|
|
|
|
|
|
|
|
configurations {
|
2023-08-29 10:08:39 +03:00
|
|
|
configureEach {
|
2022-03-11 13:10:51 +03:00
|
|
|
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly
|
|
|
|
|
|
|
|
// check for updates every build
|
|
|
|
resolutionStrategy {
|
|
|
|
cacheChangingModulesFor 0, 'seconds'
|
|
|
|
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
configurations.configureEach {
|
|
|
|
resolutionStrategy.eachDependency {
|
|
|
|
if (requested.group == "org.checkerframework" && requested.name != "checker-compat-qual") {
|
|
|
|
useVersion(checkerVersion)
|
|
|
|
because("https://github.com/google/ExoPlayer/issues/10007")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// semantic versioning for version code
|
|
|
|
def versionMajor = 3
|
2024-04-17 13:14:00 +03:00
|
|
|
def versionMinor = 30
|
2022-03-11 13:10:51 +03:00
|
|
|
def versionPatch = 0
|
|
|
|
def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
|
|
|
|
|
2022-03-15 16:41:05 +03:00
|
|
|
|
|
|
|
def ndkEnv = new HashMap<String, String>()
|
|
|
|
file("$project.rootDir/ndk.env").readLines().each() {
|
|
|
|
def (key, value) = it.tokenize('=')
|
|
|
|
ndkEnv.put(key, value)
|
|
|
|
}
|
|
|
|
|
2022-11-23 12:37:35 +03:00
|
|
|
def perfAnalysis = project.hasProperty('perfAnalysis')
|
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
android {
|
2022-03-15 12:22:23 +03:00
|
|
|
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
|
2022-03-15 16:41:05 +03:00
|
|
|
ndkVersion "${ndkEnv.get("NDK_VERSION")}"
|
2022-03-11 13:10:51 +03:00
|
|
|
|
2022-09-16 12:00:39 +03:00
|
|
|
|
|
|
|
namespace 'com.owncloud.android'
|
|
|
|
testNamespace "${namespace}.test"
|
|
|
|
|
2024-04-14 00:00:19 +03:00
|
|
|
androidResources {
|
|
|
|
generateLocaleConfig = true
|
|
|
|
}
|
2022-09-16 12:00:39 +03:00
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
defaultConfig {
|
2024-04-15 10:50:15 +03:00
|
|
|
applicationId "com.nextcloud.client"
|
2023-03-24 10:52:25 +03:00
|
|
|
minSdkVersion 24
|
2023-10-30 11:58:19 +03:00
|
|
|
targetSdkVersion 34
|
|
|
|
compileSdk 34
|
2022-03-11 13:10:51 +03:00
|
|
|
|
|
|
|
buildConfigField 'boolean', 'CI', ciBuild.toString()
|
2022-11-23 12:37:35 +03:00
|
|
|
buildConfigField 'boolean', 'RUNTIME_PERF_ANALYSIS', perfAnalysis.toString()
|
2022-03-11 13:10:51 +03:00
|
|
|
|
2022-11-03 18:38:19 +03:00
|
|
|
javaCompileOptions {
|
|
|
|
annotationProcessorOptions {
|
|
|
|
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
// arguments to be passed to functional tests
|
2024-02-22 12:13:22 +03:00
|
|
|
if (shotTest) {
|
|
|
|
testInstrumentationRunner "com.karumi.shot.ShotTestRunner"
|
|
|
|
} else {
|
|
|
|
testInstrumentationRunner "com.nextcloud.client.TestRunner"
|
|
|
|
}
|
2022-03-11 13:10:51 +03:00
|
|
|
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
|
|
|
|
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
|
|
|
|
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"
|
|
|
|
testInstrumentationRunnerArguments disableAnalytics: 'true'
|
|
|
|
|
|
|
|
versionCode versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
|
|
|
|
|
|
|
|
if (versionBuild > 89) {
|
|
|
|
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
|
|
|
|
} else if (versionBuild > 50) {
|
|
|
|
versionName "${versionMajor}.${versionMinor}.${versionPatch} RC" + (versionBuild - 50)
|
|
|
|
} else {
|
|
|
|
versionName "${versionMajor}.${versionMinor}.${versionPatch} Alpha" + (versionBuild + 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
// adapt structure from Eclipse to Gradle/Android Studio expectations;
|
|
|
|
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
|
|
|
|
|
2023-08-29 10:08:39 +03:00
|
|
|
flavorDimensions += "default"
|
2022-03-11 13:10:51 +03:00
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
debug {
|
2022-09-07 14:19:50 +03:00
|
|
|
testCoverageEnabled(project.hasProperty('coverage'))
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-01 19:37:35 +03:00
|
|
|
buildFeatures {
|
|
|
|
buildConfig = true
|
|
|
|
}
|
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
productFlavors {
|
|
|
|
// used for f-droid
|
|
|
|
generic {
|
|
|
|
applicationId 'com.nextcloud.client'
|
|
|
|
dimension "default"
|
|
|
|
}
|
|
|
|
|
|
|
|
gplay {
|
|
|
|
applicationId 'com.nextcloud.client'
|
|
|
|
dimension "default"
|
|
|
|
}
|
|
|
|
|
|
|
|
huawei {
|
|
|
|
applicationId 'com.nextcloud.client'
|
|
|
|
dimension "default"
|
|
|
|
}
|
|
|
|
|
|
|
|
versionDev {
|
|
|
|
applicationId "com.nextcloud.android.beta"
|
|
|
|
dimension "default"
|
2024-12-02 04:44:56 +03:00
|
|
|
versionCode 20241202
|
|
|
|
versionName "20241202"
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
qa {
|
|
|
|
applicationId "com.nextcloud.android.qa"
|
|
|
|
dimension "default"
|
|
|
|
versionCode 1
|
|
|
|
versionName "1"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-03 18:38:19 +03:00
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
testOptions {
|
|
|
|
unitTests.returnDefaultValues = true
|
|
|
|
animationsDisabled true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// adapt structure from Eclipse to Gradle/Android Studio expectations;
|
|
|
|
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
|
|
|
|
packagingOptions {
|
|
|
|
resources {
|
2022-09-30 11:00:24 +03:00
|
|
|
excludes += 'META-INF/LICENSE*'
|
2024-04-23 12:39:36 +03:00
|
|
|
excludes += 'META-INF/versions/9/OSGI-INF/MANIFEST*'
|
2022-09-30 11:00:24 +03:00
|
|
|
pickFirst 'MANIFEST.MF' // workaround for duplicated manifest on some dependencies
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("checkstyle", Checkstyle) {
|
|
|
|
configFile = file("${rootProject.projectDir}/checkstyle.xml")
|
|
|
|
configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
|
|
|
|
source 'src'
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/gen/**'
|
|
|
|
classpath = files()
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("pmd", Pmd) {
|
|
|
|
ruleSetFiles = files("${project.rootDir}/ruleset.xml")
|
|
|
|
ignoreFailures = true // should continue checking
|
|
|
|
ruleSets = []
|
|
|
|
|
|
|
|
source 'src'
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/gen/**'
|
|
|
|
|
|
|
|
reports {
|
|
|
|
xml {
|
|
|
|
destination = file("$project.buildDir/reports/pmd/pmd.xml")
|
|
|
|
}
|
|
|
|
html {
|
|
|
|
destination = file("$project.buildDir/reports/pmd/pmd.html")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-07 18:49:05 +03:00
|
|
|
check.dependsOn 'checkstyle', 'spotbugsGplayDebug', 'pmd', 'lint', 'spotlessKotlinCheck', 'detekt'
|
2022-03-11 13:10:51 +03:00
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
dataBinding true
|
|
|
|
viewBinding true
|
2023-05-08 19:30:06 +03:00
|
|
|
aidl true
|
2024-02-26 18:57:41 +03:00
|
|
|
compose = true
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
2023-05-09 10:01:19 +03:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
2023-05-08 19:37:38 +03:00
|
|
|
jvmTarget = "17"
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
lint {
|
|
|
|
abortOnError false
|
|
|
|
checkGeneratedSources true
|
|
|
|
disable 'MissingTranslation', 'GradleDependency', 'VectorPath', 'IconMissingDensityFolder', 'IconDensities', 'GoogleAppIndexingWarning', 'MissingDefaultResource', 'InvalidPeriodicWorkRequestInterval', 'StringFormatInvalid', 'MissingQuantity'
|
|
|
|
htmlOutput file("$project.buildDir/reports/lint/lint.html")
|
|
|
|
htmlReport true
|
|
|
|
}
|
|
|
|
|
2023-01-24 13:21:01 +03:00
|
|
|
sourceSets {
|
|
|
|
// Adds exported schema location as test app assets.
|
|
|
|
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
|
|
|
}
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-09-07 14:19:50 +03:00
|
|
|
implementation("com.github.nextcloud:android-library:$androidLibraryVersion") {
|
2022-03-11 13:10:51 +03:00
|
|
|
exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version
|
|
|
|
}
|
|
|
|
|
2024-02-26 18:57:41 +03:00
|
|
|
// Jetpack Compose
|
2024-11-20 14:19:40 +03:00
|
|
|
implementation(platform("androidx.compose:compose-bom:2024.11.00"))
|
2024-02-26 18:57:41 +03:00
|
|
|
implementation("androidx.compose.ui:ui")
|
|
|
|
implementation("androidx.compose.ui:ui-graphics")
|
|
|
|
implementation("androidx.compose.material3:material3")
|
2024-10-01 14:19:40 +03:00
|
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
2024-02-26 18:57:41 +03:00
|
|
|
|
2023-01-24 13:21:01 +03:00
|
|
|
compileOnly 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
|
|
|
|
// remove after entire switch to lib v2
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
|
|
|
|
implementation 'org.apache.jackrabbit:jackrabbit-webdav:2.13.5' // remove after entire switch to lib v2
|
2024-11-05 14:17:18 +03:00
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
2024-06-17 12:56:25 +03:00
|
|
|
implementation 'com.google.android.material:material:1.12.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation 'com.jakewharton:disklrucache:2.0.2'
|
2023-01-20 18:43:28 +03:00
|
|
|
implementation "androidx.appcompat:appcompat:$appCompatVersion"
|
2024-10-10 22:13:11 +03:00
|
|
|
implementation 'androidx.webkit:webkit:1.12.1'
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
2024-01-29 10:02:48 +03:00
|
|
|
implementation 'androidx.exifinterface:exifinterface:1.3.7'
|
2024-11-07 13:31:15 +03:00
|
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7"
|
2024-11-07 13:29:40 +03:00
|
|
|
implementation "androidx.lifecycle:lifecycle-service:2.8.7"
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation "androidx.work:work-runtime:$workRuntime"
|
|
|
|
implementation "androidx.work:work-runtime-ktx:$workRuntime"
|
2024-11-05 14:11:45 +03:00
|
|
|
implementation "androidx.fragment:fragment-ktx:1.8.5"
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
|
|
|
|
compileOnly 'com.google.code.findbugs:annotations:3.0.1u2'
|
2024-11-20 20:23:36 +03:00
|
|
|
implementation 'commons-io:commons-io:2.18.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation 'org.greenrobot:eventbus:3.3.1'
|
2024-02-04 18:10:04 +03:00
|
|
|
implementation 'com.googlecode.ez-vcard:ez-vcard:0.12.1'
|
2024-05-10 13:45:12 +03:00
|
|
|
implementation 'org.lukhnos:nnio:0.3.1'
|
2024-04-18 12:59:02 +03:00
|
|
|
implementation 'org.bouncycastle:bcpkix-jdk18on:1.78.1'
|
2024-06-28 00:07:32 +03:00
|
|
|
implementation 'com.google.code.gson:gson:2.11.0'
|
2022-08-17 13:17:29 +03:00
|
|
|
implementation 'com.github.nextcloud-deps:sectioned-recyclerview:0.6.1'
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
2024-07-15 19:59:49 +03:00
|
|
|
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.29'
|
2022-08-17 13:17:29 +03:00
|
|
|
implementation 'com.github.nextcloud-deps:qrcodescanner:0.1.2.4' // 'com.github.blikoon:QRCodeScanner:0.1.2'
|
2022-04-29 17:13:04 +03:00
|
|
|
implementation 'com.google.android.flexbox:flexbox:3.0.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
implementation('com.github.bumptech.glide:glide:3.8.0') {
|
|
|
|
exclude group: "com.android.support"
|
|
|
|
}
|
|
|
|
implementation 'com.caverock:androidsvg:1.4'
|
2024-10-30 21:34:10 +03:00
|
|
|
implementation 'androidx.annotation:annotation:1.9.1'
|
2024-06-28 00:09:18 +03:00
|
|
|
implementation 'com.vanniktech:emoji-google:0.21.0'
|
2024-11-07 13:27:26 +03:00
|
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
|
2022-03-11 13:10:51 +03:00
|
|
|
|
2022-04-06 15:40:33 +03:00
|
|
|
// document scanner not available on FDroid (generic) due to OpenCV binaries
|
2023-01-20 18:43:28 +03:00
|
|
|
gplayImplementation project(':appscan')
|
|
|
|
huaweiImplementation project(':appscan')
|
|
|
|
qaImplementation project(':appscan')
|
2022-03-11 13:10:51 +03:00
|
|
|
|
2024-02-26 18:16:07 +03:00
|
|
|
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.13.0'
|
2024-11-14 17:39:56 +03:00
|
|
|
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.8'
|
2022-03-11 13:10:51 +03:00
|
|
|
|
|
|
|
implementation "com.google.dagger:dagger:$daggerVersion"
|
|
|
|
implementation "com.google.dagger:dagger-android:$daggerVersion"
|
|
|
|
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
|
|
|
|
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
|
|
|
|
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
|
|
|
|
2024-08-21 10:40:56 +03:00
|
|
|
implementation 'org.conscrypt:conscrypt-android:2.5.3'
|
2022-03-11 13:10:51 +03:00
|
|
|
|
2024-03-07 14:10:35 +03:00
|
|
|
implementation "androidx.media3:media3-ui:$androidxMediaVersion"
|
2024-08-25 19:25:05 +03:00
|
|
|
implementation "androidx.media3:media3-session:$androidxMediaVersion"
|
2024-03-07 14:10:35 +03:00
|
|
|
implementation "androidx.media3:media3-exoplayer:$androidxMediaVersion"
|
|
|
|
implementation "androidx.media3:media3-datasource-okhttp:$androidxMediaVersion"
|
2022-03-11 13:10:51 +03:00
|
|
|
|
2024-02-04 18:12:47 +03:00
|
|
|
implementation 'me.zhanghai.android.fastscroll:library:1.3.0'
|
2022-09-07 14:19:50 +03:00
|
|
|
|
2022-03-11 13:10:51 +03:00
|
|
|
// Shimmer animation
|
2022-04-29 17:13:04 +03:00
|
|
|
implementation 'io.github.elye:loaderviewlibrary:3.0.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
|
|
|
|
// dependencies for markdown rendering
|
|
|
|
implementation "io.noties.markwon:core:$markwonVersion"
|
|
|
|
implementation "io.noties.markwon:ext-strikethrough:$markwonVersion"
|
|
|
|
implementation "io.noties.markwon:ext-tables:$markwonVersion"
|
|
|
|
implementation "io.noties.markwon:ext-tasklist:$markwonVersion"
|
|
|
|
implementation "io.noties.markwon:html:$markwonVersion"
|
|
|
|
|
|
|
|
implementation "io.noties.markwon:syntax-highlight:$markwonVersion"
|
|
|
|
implementation "io.noties:prism4j:$prismVersion"
|
|
|
|
kapt "io.noties:prism4j-bundler:$prismVersion"
|
|
|
|
|
2023-06-16 14:43:50 +03:00
|
|
|
// dependencies for image cropping and rotation
|
2024-08-09 14:32:22 +03:00
|
|
|
implementation 'com.vanniktech:android-image-cropper:4.6.0'
|
2023-06-16 14:43:50 +03:00
|
|
|
|
2024-08-21 10:43:01 +03:00
|
|
|
implementation 'org.osmdroid:osmdroid-android:6.1.20'
|
2023-08-09 18:03:20 +03:00
|
|
|
|
2022-09-07 14:19:50 +03:00
|
|
|
implementation('org.mnode.ical4j:ical4j:3.0.0') {
|
|
|
|
['org.apache.commons', 'commons-logging'].each {
|
2022-03-11 13:10:51 +03:00
|
|
|
exclude group: "$it"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-23 12:37:35 +03:00
|
|
|
if (perfAnalysis) {
|
2024-06-17 17:12:53 +03:00
|
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// dependencies for local unit tests
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
|
|
|
testImplementation "org.mockito:mockito-core:$mockitoVersion"
|
|
|
|
testImplementation "androidx.test:core:$androidxTestVersion"
|
2024-03-04 09:45:55 +03:00
|
|
|
testImplementation 'org.json:json:20240303'
|
2022-03-11 13:10:51 +03:00
|
|
|
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
|
2023-02-23 05:13:54 +03:00
|
|
|
testImplementation 'androidx.arch.core:core-testing:2.2.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
testImplementation "io.mockk:mockk:$mockkVersion"
|
|
|
|
testImplementation "io.mockk:mockk-android:$mockkVersion"
|
|
|
|
|
|
|
|
// dependencies for instrumented tests
|
|
|
|
// JUnit4 Rules
|
2024-06-28 00:00:49 +03:00
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
2022-03-11 13:10:51 +03:00
|
|
|
androidTestImplementation "androidx.test:rules:$androidxTestVersion"
|
|
|
|
// Android JUnit Runner
|
2024-08-18 02:01:47 +03:00
|
|
|
androidTestImplementation "androidx.test:runner:1.6.2"
|
2024-10-18 14:00:34 +03:00
|
|
|
androidTestUtil "androidx.test:orchestrator:1.5.1"
|
2022-04-26 13:02:33 +03:00
|
|
|
androidTestImplementation "androidx.test:core-ktx:$androidxTestVersion"
|
2022-03-11 13:10:51 +03:00
|
|
|
|
2022-03-16 12:01:04 +03:00
|
|
|
// Espresso
|
2022-03-11 13:10:51 +03:00
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
|
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
|
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion"
|
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-accessibility:$espressoVersion"
|
2022-03-16 12:01:04 +03:00
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
|
2024-08-08 11:15:43 +03:00
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
|
2022-03-11 13:10:51 +03:00
|
|
|
|
|
|
|
// Mocking support
|
|
|
|
androidTestImplementation 'com.github.tmurakami:dexopener:2.0.5' // required to allow mocking on API 27 and older
|
|
|
|
androidTestImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
|
|
|
|
androidTestImplementation "org.mockito:mockito-core:$mockitoVersion"
|
2022-06-27 12:35:24 +03:00
|
|
|
androidTestImplementation("org.mockito:mockito-android:$mockitoVersion")
|
2022-03-11 13:10:51 +03:00
|
|
|
androidTestImplementation "io.mockk:mockk-android:$mockkVersion"
|
2023-02-23 05:13:54 +03:00
|
|
|
androidTestImplementation 'androidx.arch.core:core-testing:2.2.0'
|
2022-03-11 13:10:51 +03:00
|
|
|
androidTestImplementation "com.facebook.testing.screenshot:core:0.15.0"
|
|
|
|
|
|
|
|
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
|
|
|
|
// androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
|
|
|
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
|
|
|
|
//androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
|
|
|
|
androidTestImplementation 'tools.fastlane:screengrab:2.1.1'
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
|
|
|
|
|
|
implementation "com.github.stateless4j:stateless4j:2.6.0"
|
|
|
|
|
|
|
|
// upon each update first test: new registration, receive push
|
2024-11-15 02:14:02 +03:00
|
|
|
gplayImplementation "com.google.firebase:firebase-messaging:24.1.0"
|
2024-06-27 11:56:04 +03:00
|
|
|
gplayImplementation 'com.google.android.gms:play-services-base:18.5.0'
|
2024-10-19 13:41:56 +03:00
|
|
|
gplayImplementation 'com.google.android.play:review-ktx:2.0.2'
|
2022-09-06 19:14:36 +03:00
|
|
|
|
2024-10-23 19:45:38 +03:00
|
|
|
implementation 'com.github.nextcloud.android-common:ui:0.23.2'
|
2022-11-03 00:32:38 +03:00
|
|
|
|
|
|
|
implementation "androidx.room:room-runtime:$roomVersion"
|
2023-08-29 10:08:39 +03:00
|
|
|
ksp "androidx.room:room-compiler:$roomVersion"
|
2023-01-24 13:21:01 +03:00
|
|
|
androidTestImplementation "androidx.room:room-testing:$roomVersion"
|
2022-11-03 00:32:38 +03:00
|
|
|
|
2024-07-18 19:40:39 +03:00
|
|
|
implementation "io.coil-kt:coil:2.7.0"
|
2023-04-04 19:22:02 +03:00
|
|
|
|
2023-09-05 14:33:39 +03:00
|
|
|
// splash screen dependency ref: https://developer.android.com/develop/ui/views/launch/splash-screen/migrate
|
2023-06-09 04:57:15 +03:00
|
|
|
implementation 'androidx.core:core-splashscreen:1.0.1'
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
2023-08-29 10:08:39 +03:00
|
|
|
configurations.configureEach {
|
2022-09-07 14:19:50 +03:00
|
|
|
resolutionStrategy {
|
2022-03-11 13:10:51 +03:00
|
|
|
cacheChangingModulesFor 0, 'seconds'
|
2024-06-16 11:22:51 +03:00
|
|
|
force 'org.objenesis:objenesis:3.4'
|
2022-03-11 13:10:51 +03:00
|
|
|
eachDependency { details ->
|
|
|
|
if ('org.jacoco' == details.requested.group) {
|
|
|
|
details.useVersion "$jacoco_version"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 10:08:39 +03:00
|
|
|
tasks.withType(Test).configureEach {
|
2022-03-11 13:10:51 +03:00
|
|
|
// increased logging for tests
|
|
|
|
testLogging {
|
|
|
|
events "passed", "skipped", "failed"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 10:08:39 +03:00
|
|
|
android.applicationVariants.configureEach { variant ->
|
2023-09-05 14:33:39 +03:00
|
|
|
variant.outputs.configureEach { output -> outputFileName = "${output.baseName}-${variant.versionCode}.apk"
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-07 18:42:29 +03:00
|
|
|
spotless {
|
|
|
|
kotlin {
|
|
|
|
target "**/*.kt"
|
|
|
|
ktlint()
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
detekt {
|
2023-08-29 10:08:39 +03:00
|
|
|
config.setFrom("detekt.yml")
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
2024-02-22 12:13:22 +03:00
|
|
|
if (shotTest) {
|
|
|
|
shot {
|
|
|
|
showOnlyFailingTestsInReports = ciBuild
|
|
|
|
// CI environment renders some shadows slightly different from local VMs
|
|
|
|
// Add a 0.5% tolerance to account for that
|
2024-10-11 09:37:38 +03:00
|
|
|
tolerance = ciBuild ? 0.1 : 0
|
2024-02-22 12:13:22 +03:00
|
|
|
}
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
jacoco {
|
|
|
|
toolVersion = "$jacoco_version"
|
|
|
|
}
|
|
|
|
|
|
|
|
spotbugs {
|
|
|
|
ignoreFailures = true // should continue checking
|
2024-01-29 14:35:23 +03:00
|
|
|
effort = Effort.MAX
|
|
|
|
reportLevel = Confidence.valueOf('MEDIUM')
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
|
2024-03-01 13:22:38 +03:00
|
|
|
tasks.withType(SpotBugsTask){task ->
|
2022-03-11 13:10:51 +03:00
|
|
|
String variantNameCap = task.name.replace("spotbugs", "")
|
|
|
|
String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1)
|
|
|
|
dependsOn "compile${variantNameCap}Sources"
|
|
|
|
|
2024-03-01 13:49:37 +03:00
|
|
|
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/compile${variantNameCap}JavaWithJavac/classes/")
|
2024-03-01 13:55:51 +03:00
|
|
|
excludeFilter = file("${project.rootDir}/scripts/analysis/spotbugs-filter.xml")
|
2022-03-11 13:10:51 +03:00
|
|
|
reports {
|
2022-03-24 11:03:00 +03:00
|
|
|
xml {
|
2022-03-24 13:20:33 +03:00
|
|
|
required = true
|
2022-03-24 11:03:00 +03:00
|
|
|
}
|
2022-03-11 13:10:51 +03:00
|
|
|
html {
|
2022-03-24 11:03:00 +03:00
|
|
|
required = true
|
|
|
|
outputLocation = file("$project.buildDir/reports/spotbugs/spotbugs.html")
|
|
|
|
stylesheet = 'fancy.xsl'
|
2022-03-11 13:10:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-08-29 10:08:39 +03:00
|
|
|
|
|
|
|
ksp {
|
|
|
|
arg('room.schemaLocation', "$projectDir/schemas")
|
|
|
|
}
|