diff --git a/app/build.gradle b/app/build.gradle index 8db9e99d25..ef616cf263 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ buildscript { dependencies { classpath "com.android.tools.build:gradle:$androidPluginVersion" classpath libs.spotbugs.gradle.plugin - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8" + classpath libs.kotlin.gradle.plugin + classpath libs.detekt.gradle.plugin classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2 classpath "com.karumi:shot:6.1.0" classpath "org.jacoco:org.jacoco.core:$jacoco_version" @@ -29,9 +29,9 @@ buildscript { plugins { alias(libs.plugins.kotlin.compose) - id "com.diffplug.spotless" version "6.25.0" - id "org.jetbrains.kotlin.kapt" version "2.1.20" - id "com.google.devtools.ksp" version "2.1.20-1.0.32" apply false + alias(libs.plugins.spotless) + alias(libs.plugins.kapt) + alias(libs.plugins.ksp) apply false } apply plugin: "com.android.application" @@ -272,13 +272,35 @@ dependencies { exclude group: "org.ogce", module: "xpp3" // unused in Android and brings wrong Junit version } + // splash screen dependency ref: https://developer.android.com/develop/ui/views/launch/splash-screen/migrate + implementation libs.splashscreen + // Jetpack Compose - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.androidx.ui) - implementation(libs.androidx.ui.graphics) - implementation(libs.material3) - debugImplementation(libs.androidx.ui.tooling) - implementation(libs.androidx.ui.tooling.preview) + implementation(platform(libs.compose.bom)) + implementation(libs.compose.ui) + implementation(libs.compose.ui.graphics) + implementation(libs.compose.material3) + debugImplementation(libs.compose.ui.tooling) + implementation(libs.compose.ui.tooling.preview) + + // Media3 + implementation libs.media3.ui + implementation libs.media3.session + implementation libs.media3.exoplayer + implementation libs.media3.datasource + + // Room + implementation libs.room.runtime + ksp "androidx.room:room-compiler:$roomVersion" + androidTestImplementation libs.room.testing + + // Espresso + androidTestImplementation libs.espresso.core + androidTestImplementation libs.espresso.contrib + androidTestImplementation libs.espresso.web + androidTestImplementation libs.espresso.accessibility + androidTestImplementation libs.espresso.intents + androidTestImplementation libs.espresso.idling.resource 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 @@ -334,11 +356,6 @@ dependencies { implementation "org.conscrypt:conscrypt-android:2.5.3" - implementation "androidx.media3:media3-ui:$androidxMediaVersion" - implementation "androidx.media3:media3-session:$androidxMediaVersion" - implementation "androidx.media3:media3-exoplayer:$androidxMediaVersion" - implementation "androidx.media3:media3-datasource-okhttp:$androidxMediaVersion" - implementation "me.zhanghai.android.fastscroll:library:1.3.0" // Shimmer animation @@ -389,14 +406,6 @@ dependencies { androidTestUtil "androidx.test:orchestrator:1.5.1" androidTestImplementation "androidx.test:core-ktx:$androidxTestVersion" - // Espresso - 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" - androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion" - androidTestImplementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion" - // 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" @@ -422,14 +431,7 @@ dependencies { implementation "com.github.nextcloud.android-common:ui:$androidCommonLibraryVersion" - implementation "androidx.room:room-runtime:$roomVersion" - ksp "androidx.room:room-compiler:$roomVersion" - androidTestImplementation "androidx.room:room-testing:$roomVersion" - implementation "io.coil-kt:coil:2.7.0" - - // splash screen dependency ref: https://developer.android.com/develop/ui/views/launch/splash-screen/migrate - implementation libs.androidx.core.splashscreen } configurations.configureEach { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6660cfa217..36e94ec306 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,22 +2,54 @@ # SPDX-License-Identifier: AGPL-3.0-or-later [versions] +espressoVersion = "3.6.1" +media3 = "1.5.1" +roomVersion = "2.6.1" splash-screen = "1.0.1" kotlin = "2.1.20" composeBom = "2025.03.01" spotbugsGradlePlugin = "6.1.7" +detektGradlePlugin = "1.23.8" +spotless = "6.25.0" +ksp = "2.1.20-1.0.32" [libraries] -androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "splash-screen" } +# Splash Screen +splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "splash-screen" } # Jetpack Compose -androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } -androidx-ui = { module = "androidx.compose.ui:ui" } -androidx-ui-graphics = { module = "androidx.compose.ui:ui-graphics" } -androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } -androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } -material3 = { module = "androidx.compose.material3:material3" } +compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } +compose-ui = { module = "androidx.compose.ui:ui" } +compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" } +compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } +compose-material3 = { module = "androidx.compose.material3:material3" } + +# Media3 +media3-datasource = { module = "androidx.media3:media3-datasource-okhttp", version.ref = "media3" } +media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "media3" } +media3-session = { module = "androidx.media3:media3-session", version.ref = "media3" } +media3-ui = { module = "androidx.media3:media3-ui", version.ref = "media3" } + +# Room +room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomVersion" } +room-testing = { module = "androidx.room:room-testing", version.ref = "roomVersion" } + +# Espresso +espresso-accessibility = { module = "androidx.test.espresso:espresso-accessibility", version.ref = "espressoVersion" } +espresso-contrib = { module = "androidx.test.espresso:espresso-contrib", version.ref = "espressoVersion" } +espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoVersion" } +espresso-idling-resource = { module = "androidx.test.espresso:espresso-idling-resource", version.ref = "espressoVersion" } +espresso-intents = { module = "androidx.test.espresso:espresso-intents", version.ref = "espressoVersion" } +espresso-web = { module = "androidx.test.espresso:espresso-web", version.ref = "espressoVersion" } + +# Gradle Plugins spotbugs-gradle-plugin = { module = "com.github.spotbugs.snom:spotbugs-gradle-plugin", version.ref = "spotbugsGradlePlugin" } +kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +detekt-gradle-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detektGradlePlugin" } [plugins] -kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } \ No newline at end of file +kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } +kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }