Prepare for build with *.kts files

Signed-off-by: Hannes Achleitner <hannes.software@gmx.at>
This commit is contained in:
Hannes Achleitner 2025-02-19 07:03:54 +01:00 committed by Andy Scherzinger
parent 30cd4d134c
commit 9cf3f151f6
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
6 changed files with 166 additions and 172 deletions

View File

@ -16,11 +16,11 @@ import org.gradle.internal.jvm.Jvm
buildscript { buildscript {
dependencies { dependencies {
classpath "com.android.tools.build:gradle:$androidPluginVersion" classpath "com.android.tools.build:gradle:$androidPluginVersion"
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.1.7' classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.1.7"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8" classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8"
classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2 classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
classpath 'com.karumi:shot:6.1.0' classpath "com.karumi:shot:6.1.0"
classpath "org.jacoco:org.jacoco.core:$jacoco_version" classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jacoco:org.jacoco.report:$jacoco_version" classpath "org.jacoco:org.jacoco.report:$jacoco_version"
classpath "org.jacoco:org.jacoco.agent:$jacoco_version" classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
@ -31,36 +31,36 @@ plugins {
id "org.jetbrains.kotlin.plugin.compose" version "2.1.10" id "org.jetbrains.kotlin.plugin.compose" version "2.1.10"
id "com.diffplug.spotless" version "6.25.0" id "com.diffplug.spotless" version "6.25.0"
id "org.jetbrains.kotlin.kapt" version "2.1.10" id "org.jetbrains.kotlin.kapt" version "2.1.10"
id 'com.google.devtools.ksp' version '2.1.10-1.0.31' apply false id "com.google.devtools.ksp" version "2.1.10-1.0.31" apply false
} }
apply plugin: 'com.android.application' apply plugin: "com.android.application"
apply plugin: 'kotlin-android' apply plugin: "kotlin-android"
apply plugin: 'kotlin-parcelize' apply plugin: "kotlin-parcelize"
apply plugin: 'checkstyle' apply plugin: "checkstyle"
apply plugin: 'pmd' apply plugin: "pmd"
apply from: "$rootProject.projectDir/jacoco.gradle" apply from: "$rootProject.projectDir/jacoco.gradle"
apply plugin: 'com.github.spotbugs' apply plugin: "com.github.spotbugs"
apply plugin: 'io.gitlab.arturbosch.detekt' apply plugin: "io.gitlab.arturbosch.detekt"
// needed to make renovate run without shot, as shot requires Android SDK // needed to make renovate run without shot, as shot requires Android SDK
// https://github.com/pedrovgs/Shot/issues/300 // https://github.com/pedrovgs/Shot/issues/300
if (shotTest) { if (shotTest) {
apply plugin: 'shot' apply plugin: "shot"
} }
apply plugin: 'com.google.devtools.ksp' apply plugin: "com.google.devtools.ksp"
println "Gradle uses Java ${Jvm.current()}" println "Gradle uses Java ${Jvm.current()}"
configurations { configurations {
configureEach { configureEach {
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly exclude group: "org.jetbrains", module: "annotations-java5" // via prism4j, already using annotations explicitly
// check for updates every build // check for updates every build
resolutionStrategy { resolutionStrategy {
cacheChangingModulesFor 0, 'seconds' cacheChangingModulesFor 0, "seconds"
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug" exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
} }
} }
@ -85,18 +85,18 @@ def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
def ndkEnv = new HashMap<String, String>() def ndkEnv = new HashMap<String, String>()
file("$project.rootDir/ndk.env").readLines().each() { file("$project.rootDir/ndk.env").readLines().each() {
def (key, value) = it.tokenize('=') def (key, value) = it.tokenize("=")
ndkEnv.put(key, value) ndkEnv.put(key, value)
} }
def perfAnalysis = project.hasProperty('perfAnalysis') def perfAnalysis = project.hasProperty("perfAnalysis")
android { android {
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed // install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
ndkVersion "${ndkEnv.get("NDK_VERSION")}" ndkVersion "${ndkEnv.get("NDK_VERSION")}"
namespace 'com.owncloud.android' namespace "com.owncloud.android"
testNamespace "${namespace}.test" testNamespace "${namespace}.test"
androidResources { androidResources {
@ -109,8 +109,8 @@ android {
targetSdkVersion 35 targetSdkVersion 35
compileSdk 35 compileSdk 35
buildConfigField 'boolean', 'CI', ciBuild.toString() buildConfigField "boolean", "CI", ciBuild.toString()
buildConfigField 'boolean', 'RUNTIME_PERF_ANALYSIS', perfAnalysis.toString() buildConfigField "boolean", "RUNTIME_PERF_ANALYSIS", perfAnalysis.toString()
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {
@ -127,7 +127,7 @@ android {
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}" testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}" testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}" testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"
testInstrumentationRunnerArguments disableAnalytics: 'true' testInstrumentationRunnerArguments disableAnalytics: "true"
versionCode versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild versionCode versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
@ -146,7 +146,7 @@ android {
buildTypes { buildTypes {
debug { debug {
testCoverageEnabled(project.hasProperty('coverage')) testCoverageEnabled(project.hasProperty("coverage"))
resConfigs "xxxhdpi" resConfigs "xxxhdpi"
} }
} }
@ -158,17 +158,17 @@ android {
productFlavors { productFlavors {
// used for f-droid // used for f-droid
generic { generic {
applicationId 'com.nextcloud.client' applicationId "com.nextcloud.client"
dimension "default" dimension "default"
} }
gplay { gplay {
applicationId 'com.nextcloud.client' applicationId "com.nextcloud.client"
dimension "default" dimension "default"
} }
huawei { huawei {
applicationId 'com.nextcloud.client' applicationId "com.nextcloud.client"
dimension "default" dimension "default"
} }
@ -197,18 +197,18 @@ android {
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure // see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
packagingOptions { packagingOptions {
resources { resources {
excludes += 'META-INF/LICENSE*' excludes += "META-INF/LICENSE*"
excludes += 'META-INF/versions/9/OSGI-INF/MANIFEST*' excludes += "META-INF/versions/9/OSGI-INF/MANIFEST*"
pickFirst 'MANIFEST.MF' // workaround for duplicated manifest on some dependencies pickFirst "MANIFEST.MF" // workaround for duplicated manifest on some dependencies
} }
} }
tasks.register("checkstyle", Checkstyle) { tasks.register("checkstyle", Checkstyle) {
configFile = file("${rootProject.projectDir}/checkstyle.xml") configFile = file("${rootProject.projectDir}/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
source 'src' source "src"
include '**/*.java' include "**/*.java"
exclude '**/gen/**' exclude "**/gen/**"
classpath = files() classpath = files()
} }
@ -217,9 +217,9 @@ android {
ignoreFailures = true // should continue checking ignoreFailures = true // should continue checking
ruleSets = [] ruleSets = []
source 'src' source "src"
include '**/*.java' include "**/*.java"
exclude '**/gen/**' exclude "**/gen/**"
reports { reports {
xml { xml {
@ -231,7 +231,7 @@ android {
} }
} }
check.dependsOn 'checkstyle', 'spotbugsGplayDebug', 'pmd', 'lint', 'spotlessKotlinCheck', 'detekt' check.dependsOn "checkstyle", "spotbugsGplayDebug", "pmd", "lint", "spotlessKotlinCheck", "detekt"
buildFeatures { buildFeatures {
dataBinding true dataBinding true
@ -252,7 +252,7 @@ android {
lint { lint {
abortOnError false abortOnError false
checkGeneratedSources true checkGeneratedSources true
disable 'MissingTranslation', 'GradleDependency', 'VectorPath', 'IconMissingDensityFolder', 'IconDensities', 'GoogleAppIndexingWarning', 'MissingDefaultResource', 'InvalidPeriodicWorkRequestInterval', 'StringFormatInvalid', 'MissingQuantity' disable "MissingTranslation", "GradleDependency", "VectorPath", "IconMissingDensityFolder", "IconDensities", "GoogleAppIndexingWarning", "MissingDefaultResource", "InvalidPeriodicWorkRequestInterval", "StringFormatInvalid", "MissingQuantity"
htmlOutput file("$project.buildDir/reports/lint/lint.html") htmlOutput file("$project.buildDir/reports/lint/lint.html")
htmlReport true htmlReport true
} }
@ -269,7 +269,7 @@ android {
dependencies { dependencies {
implementation("com.github.nextcloud:android-library:$androidLibraryVersion") { implementation("com.github.nextcloud:android-library:$androidLibraryVersion") {
exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version exclude group: "org.ogce", module: "xpp3" // unused in Android and brings wrong Junit version
} }
// Jetpack Compose // Jetpack Compose
@ -280,51 +280,51 @@ dependencies {
debugImplementation("androidx.compose.ui:ui-tooling") debugImplementation("androidx.compose.ui:ui-tooling")
implementation("androidx.compose.ui:ui-tooling-preview") implementation("androidx.compose.ui:ui-tooling-preview")
compileOnly 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' 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 // remove after entire switch to lib v2
implementation "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2 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 implementation "org.apache.jackrabbit:jackrabbit-webdav:2.13.5" // remove after entire switch to lib v2
implementation 'androidx.constraintlayout:constraintlayout:2.2.1' implementation "androidx.constraintlayout:constraintlayout:2.2.1"
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'com.google.android.material:material:1.12.0' implementation "com.google.android.material:material:1.12.0"
implementation 'com.jakewharton:disklrucache:2.0.2' implementation "com.jakewharton:disklrucache:2.0.2"
implementation "androidx.appcompat:appcompat:$appCompatVersion" implementation "androidx.appcompat:appcompat:$appCompatVersion"
implementation 'androidx.webkit:webkit:1.12.1' implementation "androidx.webkit:webkit:1.12.1"
implementation 'androidx.cardview:cardview:1.0.0' implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.exifinterface:exifinterface:1.4.0' implementation "androidx.exifinterface:exifinterface:1.4.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7"
implementation "androidx.lifecycle:lifecycle-service:2.8.7" implementation "androidx.lifecycle:lifecycle-service:2.8.7"
implementation "androidx.work:work-runtime:$workRuntime" implementation "androidx.work:work-runtime:$workRuntime"
implementation "androidx.work:work-runtime-ktx:$workRuntime" implementation "androidx.work:work-runtime-ktx:$workRuntime"
implementation "androidx.fragment:fragment-ktx:1.8.6" implementation "androidx.fragment:fragment-ktx:1.8.6"
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7 implementation "com.github.albfernandez:juniversalchardet:2.0.3" // need this version for Android <7
compileOnly 'com.google.code.findbugs:annotations:3.0.1u2' compileOnly "com.google.code.findbugs:annotations:3.0.1u2"
implementation 'commons-io:commons-io:2.18.0' implementation "commons-io:commons-io:2.18.0"
implementation 'org.greenrobot:eventbus:3.3.1' implementation "org.greenrobot:eventbus:3.3.1"
implementation 'com.googlecode.ez-vcard:ez-vcard:0.12.1' implementation "com.googlecode.ez-vcard:ez-vcard:0.12.1"
implementation 'org.lukhnos:nnio:0.3.1' implementation "org.lukhnos:nnio:0.3.1"
implementation 'org.bouncycastle:bcpkix-jdk18on:1.80' implementation "org.bouncycastle:bcpkix-jdk18on:1.80"
implementation 'com.google.code.gson:gson:2.12.1' implementation "com.google.code.gson:gson:2.12.1"
implementation 'com.github.nextcloud-deps:sectioned-recyclerview:0.6.1' implementation "com.github.nextcloud-deps:sectioned-recyclerview:0.6.1"
implementation 'com.github.chrisbanes:PhotoView:2.3.0' implementation "com.github.chrisbanes:PhotoView:2.3.0"
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.29' implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.29"
implementation 'com.github.nextcloud-deps:qrcodescanner:0.1.2.4' // 'com.github.blikoon:QRCodeScanner:0.1.2' implementation "com.github.nextcloud-deps:qrcodescanner:0.1.2.4" // "com.github.blikoon:QRCodeScanner:0.1.2"
implementation 'com.google.android.flexbox:flexbox:3.0.0' implementation "com.google.android.flexbox:flexbox:3.0.0"
implementation('com.github.bumptech.glide:glide:3.8.0') { implementation("com.github.bumptech.glide:glide:3.8.0") {
exclude group: "com.android.support" exclude group: "com.android.support"
} }
implementation 'com.caverock:androidsvg:1.4' implementation "com.caverock:androidsvg:1.4"
implementation 'androidx.annotation:annotation:1.9.1' implementation "androidx.annotation:annotation:1.9.1"
implementation 'com.vanniktech:emoji-google:0.21.0' implementation "com.vanniktech:emoji-google:0.21.0"
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
// document scanner not available on FDroid (generic) due to OpenCV binaries // document scanner not available on FDroid (generic) due to OpenCV binaries
gplayImplementation project(':appscan') gplayImplementation project(":appscan")
huaweiImplementation project(':appscan') huaweiImplementation project(":appscan")
qaImplementation project(':appscan') qaImplementation project(":appscan")
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.13.0' spotbugsPlugins "com.h3xstream.findsecbugs:findsecbugs-plugin:1.13.0"
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.9' spotbugsPlugins "com.mebigfatguy.fb-contrib:fb-contrib:7.6.9"
implementation "com.google.dagger:dagger:$daggerVersion" implementation "com.google.dagger:dagger:$daggerVersion"
implementation "com.google.dagger:dagger-android:$daggerVersion" implementation "com.google.dagger:dagger-android:$daggerVersion"
@ -332,17 +332,17 @@ dependencies {
kapt "com.google.dagger:dagger-compiler:$daggerVersion" kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion" kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
implementation 'org.conscrypt:conscrypt-android:2.5.3' implementation "org.conscrypt:conscrypt-android:2.5.3"
implementation "androidx.media3:media3-ui:$androidxMediaVersion" implementation "androidx.media3:media3-ui:$androidxMediaVersion"
implementation "androidx.media3:media3-session:$androidxMediaVersion" implementation "androidx.media3:media3-session:$androidxMediaVersion"
implementation "androidx.media3:media3-exoplayer:$androidxMediaVersion" implementation "androidx.media3:media3-exoplayer:$androidxMediaVersion"
implementation "androidx.media3:media3-datasource-okhttp:$androidxMediaVersion" implementation "androidx.media3:media3-datasource-okhttp:$androidxMediaVersion"
implementation 'me.zhanghai.android.fastscroll:library:1.3.0' implementation "me.zhanghai.android.fastscroll:library:1.3.0"
// Shimmer animation // Shimmer animation
implementation 'io.github.elye:loaderviewlibrary:3.0.0' implementation "io.github.elye:loaderviewlibrary:3.0.0"
// dependencies for markdown rendering // dependencies for markdown rendering
implementation "io.noties.markwon:core:$markwonVersion" implementation "io.noties.markwon:core:$markwonVersion"
@ -356,33 +356,33 @@ dependencies {
kapt "io.noties:prism4j-bundler:$prismVersion" kapt "io.noties:prism4j-bundler:$prismVersion"
// dependencies for image cropping and rotation // dependencies for image cropping and rotation
implementation 'com.vanniktech:android-image-cropper:4.6.0' implementation "com.vanniktech:android-image-cropper:4.6.0"
implementation 'org.osmdroid:osmdroid-android:6.1.20' implementation "org.osmdroid:osmdroid-android:6.1.20"
implementation('org.mnode.ical4j:ical4j:3.0.0') { implementation("org.mnode.ical4j:ical4j:3.0.0") {
['org.apache.commons', 'commons-logging'].each { ["org.apache.commons", "commons-logging"].each {
exclude group: "$it" exclude group: "$it"
} }
} }
if (perfAnalysis) { if (perfAnalysis) {
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14' debugImplementation "com.squareup.leakcanary:leakcanary-android:2.14"
} }
// dependencies for local unit tests // dependencies for local unit tests
testImplementation 'junit:junit:4.13.2' testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:$mockitoVersion" testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "androidx.test:core:$androidxTestVersion" testImplementation "androidx.test:core:$androidxTestVersion"
testImplementation 'org.json:json:20250107' testImplementation "org.json:json:20250107"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion" testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation 'androidx.arch.core:core-testing:2.2.0' testImplementation "androidx.arch.core:core-testing:2.2.0"
testImplementation "io.mockk:mockk:$mockkVersion" testImplementation "io.mockk:mockk:$mockkVersion"
testImplementation "io.mockk:mockk-android:$mockkVersion" testImplementation "io.mockk:mockk-android:$mockkVersion"
// dependencies for instrumented tests // dependencies for instrumented tests
// JUnit4 Rules // JUnit4 Rules
androidTestImplementation 'androidx.test.ext:junit:1.2.1' androidTestImplementation "androidx.test.ext:junit:1.2.1"
androidTestImplementation "androidx.test:rules:$androidxTestVersion" androidTestImplementation "androidx.test:rules:$androidxTestVersion"
// Android JUnit Runner // Android JUnit Runner
androidTestImplementation "androidx.test:runner:1.6.2" androidTestImplementation "androidx.test:runner:1.6.2"
@ -398,27 +398,27 @@ dependencies {
androidTestImplementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
// Mocking support // Mocking support
androidTestImplementation 'com.github.tmurakami:dexopener:2.0.5' // required to allow mocking on API 27 and older 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.kotlin:mockito-kotlin:$mockitoKotlinVersion"
androidTestImplementation "org.mockito:mockito-core:$mockitoVersion" androidTestImplementation "org.mockito:mockito-core:$mockitoVersion"
androidTestImplementation("org.mockito:mockito-android:$mockitoVersion") androidTestImplementation("org.mockito:mockito-android:$mockitoVersion")
androidTestImplementation "io.mockk:mockk-android:$mockkVersion" androidTestImplementation "io.mockk:mockk-android:$mockkVersion"
androidTestImplementation 'androidx.arch.core:core-testing:2.2.0' androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
androidTestImplementation "com.facebook.testing.screenshot:core:0.15.0" 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 // UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
// androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' // androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0"
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details // fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
//androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}" //androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
androidTestImplementation 'tools.fastlane:screengrab:2.1.1' androidTestImplementation "tools.fastlane:screengrab:2.1.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.github.stateless4j:stateless4j:2.6.0" implementation "com.github.stateless4j:stateless4j:2.6.0"
// upon each update first test: new registration, receive push // upon each update first test: new registration, receive push
gplayImplementation "com.google.firebase:firebase-messaging:24.1.0" gplayImplementation "com.google.firebase:firebase-messaging:24.1.0"
gplayImplementation 'com.google.android.gms:play-services-base:18.5.0' gplayImplementation "com.google.android.gms:play-services-base:18.5.0"
gplayImplementation 'com.google.android.play:review-ktx:2.0.2' gplayImplementation "com.google.android.play:review-ktx:2.0.2"
implementation "com.github.nextcloud.android-common:ui:$androidCommonLibraryVersion" implementation "com.github.nextcloud.android-common:ui:$androidCommonLibraryVersion"
@ -429,15 +429,15 @@ dependencies {
implementation "io.coil-kt:coil:2.7.0" implementation "io.coil-kt:coil:2.7.0"
// splash screen dependency ref: https://developer.android.com/develop/ui/views/launch/splash-screen/migrate // splash screen dependency ref: https://developer.android.com/develop/ui/views/launch/splash-screen/migrate
implementation 'androidx.core:core-splashscreen:1.0.1' implementation "androidx.core:core-splashscreen:1.0.1"
} }
configurations.configureEach { configurations.configureEach {
resolutionStrategy { resolutionStrategy {
cacheChangingModulesFor 0, 'seconds' cacheChangingModulesFor 0, "seconds"
force 'org.objenesis:objenesis:3.4' force "org.objenesis:objenesis:3.4"
eachDependency { details -> eachDependency { details ->
if ('org.jacoco' == details.requested.group) { if ("org.jacoco" == details.requested.group) {
details.useVersion "$jacoco_version" details.useVersion "$jacoco_version"
} }
} }
@ -483,7 +483,7 @@ jacoco {
spotbugs { spotbugs {
ignoreFailures = true // should continue checking ignoreFailures = true // should continue checking
effort = Effort.MAX effort = Effort.MAX
reportLevel = Confidence.valueOf('MEDIUM') reportLevel = Confidence.valueOf("MEDIUM")
} }
tasks.withType(SpotBugsTask){task -> tasks.withType(SpotBugsTask){task ->
@ -500,11 +500,11 @@ tasks.withType(SpotBugsTask){task ->
html { html {
required = true required = true
outputLocation = file("$project.buildDir/reports/spotbugs/spotbugs.html") outputLocation = file("$project.buildDir/reports/spotbugs/spotbugs.html")
stylesheet = 'fancy.xsl' stylesheet = "fancy.xsl"
} }
} }
} }
ksp { ksp {
arg('room.schemaLocation', "$projectDir/schemas") arg("room.schemaLocation", "$projectDir/schemas")
} }

3
appscan/.gitignore vendored
View File

@ -1,3 +0,0 @@
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
/build

View File

@ -14,11 +14,11 @@ buildscript {
} }
} }
apply plugin: 'com.android.library' apply plugin: "com.android.library"
apply plugin: 'kotlin-android' apply plugin: "kotlin-android"
android { android {
namespace 'com.nextcloud.appscan' namespace "com.nextcloud.appscan"
defaultConfig { defaultConfig {
minSdk 25 minSdk 25
@ -40,7 +40,7 @@ android {
} }
kotlinOptions { kotlinOptions {
jvmTarget = '17' jvmTarget = "17"
} }
} }

View File

@ -12,16 +12,16 @@ buildscript {
ext { ext {
androidLibraryVersion ="be43184f87164bd5ec4f1d2ed912665203433321" androidLibraryVersion ="be43184f87164bd5ec4f1d2ed912665203433321"
androidCommonLibraryVersion = "0.25.0" androidCommonLibraryVersion = "0.25.0"
androidPluginVersion = '8.9.0' androidPluginVersion = "8.9.0"
androidxMediaVersion = '1.5.1' androidxMediaVersion = "1.5.1"
androidxTestVersion = "1.6.1" androidxTestVersion = "1.6.1"
appCompatVersion = '1.7.0' appCompatVersion = "1.7.0"
checkerVersion = "3.21.2" checkerVersion = "3.21.2"
daggerVersion = "2.55" daggerVersion = "2.55"
documentScannerVersion = "1.1.1" documentScannerVersion = "1.1.1"
espressoVersion = "3.6.1" espressoVersion = "3.6.1"
jacoco_version = '0.8.12' jacoco_version = "0.8.12"
kotlin_version = '2.1.10' kotlin_version = "2.1.10"
markwonVersion = "4.6.2" markwonVersion = "4.6.2"
mockitoVersion = "4.11.0" mockitoVersion = "4.11.0"
mockitoKotlinVersion = "4.1.0" mockitoKotlinVersion = "4.1.0"
@ -50,18 +50,18 @@ subprojects {
} }
} }
tasks.register('clean', Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
tasks.register('installGitHooks', Copy) { tasks.register("installGitHooks", Copy) {
def sourceFolder = "${rootProject.projectDir}/scripts/hooks" def sourceFolder = "${rootProject.projectDir}/scripts/hooks"
def destFolder = "${rootProject.projectDir}/.git/hooks" def destFolder = "${rootProject.projectDir}/.git/hooks"
description = "Install git hooks" description = "Install git hooks"
from(sourceFolder) { from(sourceFolder) {
include '*' include "*"
} }
into destFolder into destFolder

View File

@ -1,4 +1,4 @@
apply plugin: 'jacoco' apply plugin: "jacoco"
jacoco { jacoco {
toolVersion = "$jacoco_version" toolVersion = "$jacoco_version"
@ -10,7 +10,7 @@ subprojects {
configurations.all { configurations.all {
resolutionStrategy { resolutionStrategy {
eachDependency { details -> eachDependency { details ->
if ('org.jacoco' == details.requested.group) { if ("org.jacoco" == details.requested.group) {
details.useVersion "$jacocoVersion" details.useVersion "$jacocoVersion"
} }
} }
@ -20,9 +20,9 @@ subprojects {
project.afterEvaluate { project -> project.afterEvaluate { project ->
tasks.withType(Test) { tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*'] jacoco.excludes = ["jdk.internal.*"]
} }
final flavor = "Gplay" final flavor = "Gplay"
@ -39,57 +39,56 @@ project.afterEvaluate { project ->
} }
final fileFilter = [ final fileFilter = [
// data binding // data binding
'**/databinding/*', "**/databinding/*",
'android/databinding/**/*.class', "android/databinding/**/*.class",
'**/android/databinding/*Binding.class', "**/android/databinding/*Binding.class",
'**/android/databinding/*', "**/android/databinding/*",
'**/androidx/databinding/*', "**/androidx/databinding/*",
'**/BR.*', "**/BR.*",
// android // android
'**/R.class', "**/R.class",
'**/R$*.class', "**/R\$*.class",
'**/BuildConfig.*', "**/BuildConfig.*",
'**/Manifest*.*', "**/Manifest*.*",
'**/*Test*.*', "**/*Test*.*",
'android/**/*.*', "android/**/*.*",
// kotlin // kotlin
'**/*MapperImpl*.*', "**/*MapperImpl*.*",
'**/*$ViewInjector*.*', "**/*\$ViewInjector*.*",
'**/*$ViewBinder*.*', "**/*\$ViewBinder*.*",
'**/BuildConfig.*', "**/BuildConfig.*",
'**/*Component*.*', "**/*Component*.*",
'**/*BR*.*', "**/*BR*.*",
'**/Manifest*.*', "**/Manifest*.*",
'**/*$Lambda$*.*', "**/*\$Lambda\$*.*",
'**/*Companion*.*', "**/*Companion*.*",
'**/*Module*.*', "**/*Module*.*",
'**/*Dagger*.*', "**/*Dagger*.*",
'**/*Hilt*.*', "**/*Hilt*.*",
'**/*MembersInjector*.*', "**/*MembersInjector*.*",
'**/*_MembersInjector.class', "**/*_MembersInjector.class",
'**/*_Factory*.*', "**/*_Factory*.*",
'**/*_Provide*Factory*.*', "**/*_Provide*Factory*.*",
'**/*Extensions*.*', "**/*Extensions*.*",
// sealed and data classes // sealed and data classes
'**/*$Result.*', "**/*\$Result.*",
'**/*$Result$*.*', "**/*\$Result\$*.*",
// adapters generated by moshi // adapters generated by moshi
'**/*JsonAdapter.*', "**/*JsonAdapter.*",
// Hilt // Hilt
'**/*Module.kt', "**/*Module.kt",
'**/di/**', "**/di/**",
'dagger.hilt.internal/*', "dagger.hilt.internal/*",
'hilt_aggregated_deps/*', "hilt_aggregated_deps/*",
'**/*$Result.*', /* filtering `sealed` and `data` classes */ "**/*\$Result.*", /* filtering `sealed` and `data` classes */
'**/*$Result$*.*',/* filtering `sealed` and `data` classes */ "**/*\$Result\$*.*",/* filtering `sealed` and `data` classes */
'**/*Args*.*', /* filtering Navigation Component generated classes */ "**/*Args*.*", /* filtering Navigation Component generated classes */
'**/*Directions*.*', /* filtering Navigation Component generated classes */ "**/*Directions*.*", /* filtering Navigation Component generated classes */
'**/*inlined*.class', /* filtering inlined classes */ "**/*inlined*.class", /* filtering inlined classes */
'**/composables/**' "**/composables/**"
/* INSERT ANY OTHER JUNK YOU WANT FILTERED OUT HERE */ /* INSERT ANY OTHER JUNK YOU WANT FILTERED OUT HERE */]
]
final androidKotlinTree = fileTree(dir: "${project.buildDir}/tmp/kotlin-classes/${variant}", excludes: fileFilter) final androidKotlinTree = fileTree(dir: "${project.buildDir}/tmp/kotlin-classes/${variant}", excludes: fileFilter)
final kotlinTree = fileTree(dir: "${project.buildDir}/classes/kotlin/main", excludes: fileFilter) final kotlinTree = fileTree(dir: "${project.buildDir}/classes/kotlin/main", excludes: fileFilter)
@ -101,9 +100,7 @@ project.afterEvaluate { project ->
sourceDirectories.setFrom files([mainSrc, productFlavorSrc, buildTypeSrc]) sourceDirectories.setFrom files([mainSrc, productFlavorSrc, buildTypeSrc])
classDirectories.setFrom files([androidKotlinTree, kotlinTree, javacTree]) classDirectories.setFrom files([androidKotlinTree, kotlinTree, javacTree])
executionData.setFrom fileTree(dir: project.buildDir, includes: [ executionData.setFrom fileTree(dir: project.buildDir, includes: ["jacoco/test${variant.capitalize()}UnitTest.exec",
"jacoco/test${variant.capitalize()}UnitTest.exec", "outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.capitalize()}UnitTest.exec",])
"outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.capitalize()}UnitTest.exec",
])
} }
} }

View File

@ -4,19 +4,19 @@
* SPDX-FileCopyrightText: 2014-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2014-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only * SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/ */
rootProject.name = 'Nextcloud' rootProject.name = "Nextcloud"
include ':app' include ":app"
include ':appscan' include ":appscan"
//includeBuild('../android-common') { //includeBuild("../android-common") {
// dependencySubstitution { // dependencySubstitution {
// substitute module('com.github.nextcloud.android-common:ui') using project(':ui') // substitute module("com.github.nextcloud.android-common:ui") using project(":ui")
// } // }
//} //}
//includeBuild('../android-library') { //includeBuild("../android-library") {
// dependencySubstitution { // dependencySubstitution {
// substitute module('com.github.nextcloud:android-library') using project(':library') // substitute module("com.github.nextcloud:android-library") using project(":library")
// } // }
//} //}