From daee437ee29276a2d51657a5f9c609ed6ae5f868 Mon Sep 17 00:00:00 2001 From: David Carver Date: Sat, 14 Dec 2024 19:33:35 -0500 Subject: [PATCH] chore: Migrate to Gradle Version Catalogs --- build.gradle | 6 +- buildSrc/src/main/kotlin/Dependencies.kt | 45 ------- emby-lib/build.gradle.kts | 76 ++++++------ gradle/libs.versions.toml | 133 +++++++++++++++++++++ manager/build.gradle.kts | 14 +-- serenity-android-common/build.gradle.kts | 46 ++++---- serenity-app/build.gradle.kts | 142 +++++++++++------------ serenity-common/build.gradle.kts | 12 +- subtitle-converter/build.gradle | 8 -- subtitle-converter/build.gradle.kts | 12 ++ 10 files changed, 290 insertions(+), 204 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/Dependencies.kt create mode 100644 gradle/libs.versions.toml delete mode 100644 subtitle-converter/build.gradle create mode 100644 subtitle-converter/build.gradle.kts diff --git a/build.gradle b/build.gradle index b0d31748..801667d6 100644 --- a/build.gradle +++ b/build.gradle @@ -7,10 +7,10 @@ buildscript { } dependencies { classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.1") - classpath("com.android.tools.build:gradle:$Versions.androidPluginVersion") + classpath("com.android.tools.build:gradle:${libs.versions.androidPluginVersion.get()}") classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$Versions.kotlinVersion") - classpath("org.jetbrains.kotlin:kotlin-allopen:$Versions.kotlinVersion") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlinVersion.get()}") + classpath("org.jetbrains.kotlin:kotlin-allopen:${libs.versions.kotlinVersion.get()}") classpath("org.jacoco:org.jacoco.core:0.8.12") } } diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt deleted file mode 100644 index afd6e215..00000000 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ /dev/null @@ -1,45 +0,0 @@ -object Versions { - - const val kotlinVersion = "1.9.24" - const val androidPluginVersion = "8.5.0" - const val minSdkVersion = 27 - const val targetSdkVersion = 35 - - const val appversion = "2.1.0" - const val okhttpVersion = "4.9.1" - const val androidPriorityJobQueueVersion = "2.0.1" - const val eventBus = "3.1.1" - const val moshiKotlinVersion = "1.12.0" - const val retrofitVersion = "2.9.0" - const val jodaTimeVersion = "2.10.9.1" - const val timberVersion = "5.0.1" - const val exoplayerVersion = "2.17.1" - const val glideOkHttpVersion = "4.12.0" - const val moxyVersion = "2.2.2" - const val glideVersion = "4.12.0" - const val googleAnalyticsVersion = "16.0.4" - const val universalCharDetVersion = "1.0.3" - const val butterKnifeVersion = "10.2.1" - const val simpleXmlVersion = "2.7.1" - - const val commonsLangVersion = "3.7" - const val junitVersion = "4.13.1" - const val assertkVersion = "0.24" - const val assertjVersion = "3.11.1" - const val mockitoVersion = "5.14.2" - const val robolectricVersion = "4.14.1" - const val openglApiVersion = "gl1.1-android-2.1_r1" - const val xmlUnitVersion = "1.3" - const val assertJAndroidVersion = "1.1.1" - const val commonsioVersion = "2.6" - const val jacocoVersion = "0.8.12" - const val toothPickVersion = "3.1.0" -} - -object Dependencies { - - object Implementation { - val kotlin = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$Versions.kotlinVersion" - val toothPickRelease = "com.github.stephanenicolas.toothpick:toothpick-runtime:$Versions.toothPickVersion" - } -} \ No newline at end of file diff --git a/emby-lib/build.gradle.kts b/emby-lib/build.gradle.kts index 11c1fdc6..d2fff0a3 100644 --- a/emby-lib/build.gradle.kts +++ b/emby-lib/build.gradle.kts @@ -10,11 +10,11 @@ android { buildConfig = true } defaultConfig { - minSdkVersion(Versions.minSdkVersion) - targetSdkVersion(Versions.targetSdkVersion) + minSdkVersion(libs.versions.minSdkVersion.get()) + targetSdkVersion(libs.versions.targetSdkVersion.get()) } - compileSdkVersion(Versions.targetSdkVersion) + compileSdk = libs.versions.targetSdkVersion.get().toInt() testOptions { unitTests { isIncludeAndroidResources = true @@ -33,11 +33,11 @@ android { buildTypes { getByName("debug") { - buildConfigField("String", "CLIENT_VERSION", "\"$Versions.appversion\"") + buildConfigField("String", "CLIENT_VERSION", "\"${libs.versions.appVersion.get()}\"") } getByName("release") { - buildConfigField("String", "CLIENT_VERSION", "\"$Versions.appversion\"") + buildConfigField("String", "CLIENT_VERSION", "\"${libs.versions.appVersion.get()}") } } } @@ -45,49 +45,49 @@ android { dependencies { api(project(":serenity-common")) api(project(":serenity-android-common")) + api(project(":manager")) - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1") + implementation(libs.kotlin) + implementation(libs.kotlin.coroutines.android) + implementation(libs.kotlin.coroutines.core) - releaseApi("com.github.stephanenicolas.toothpick:toothpick-runtime:${Versions.toothPickVersion}") { + releaseApi(libs.toothpick.runtime) { exclude(group = "javax.inject") } - releaseApi("com.github.stephanenicolas.toothpick:smoothie:${Versions.toothPickVersion}") { + releaseApi(libs.toothpick.smoothie) { exclude(group = "javax.inject") } - debugImplementation("com.github.stephanenicolas.toothpick:toothpick-runtime:${Versions.toothPickVersion}") - debugImplementation("com.github.stephanenicolas.toothpick:smoothie:${Versions.toothPickVersion}") + debugImplementation(libs.toothpick.runtime) + debugImplementation(libs.toothpick.smoothie) - releaseApi("com.github.stephanenicolas.toothpick:toothpick-javax-annotations:${Versions.toothPickVersion}") - kapt("com.github.stephanenicolas.toothpick:toothpick-compiler:${Versions.toothPickVersion}") + releaseApi(libs.toothpick.javax.annotations) + kapt(libs.toothpick.compiler) - api("com.birbit:android-priority-jobqueue:${Versions.androidPriorityJobQueueVersion}") - api("org.greenrobot:eventbus:${Versions.eventBus}") - api("com.squareup.moshi:moshi-kotlin:${Versions.moshiKotlinVersion}") - api("com.squareup.retrofit2:converter-moshi:${Versions.retrofitVersion}") - api("net.danlew:android.joda:${Versions.jodaTimeVersion}") - api("com.squareup.retrofit2:retrofit:${Versions.retrofitVersion}") - api("com.squareup.okhttp3:okhttp:${Versions.okhttpVersion}") - api("com.squareup.okhttp3:logging-interceptor:${Versions.okhttpVersion}") - api(project(":manager")) - api("com.jakewharton.timber:timber:${Versions.timberVersion}") - api("com.github.nisrulz:easydeviceinfo-base:2.4.1") - api("com.github.nisrulz:easydeviceinfo-common:2.4.1") + implementation(libs.android.priority.jobqueue) + implementation(libs.eventbus) + implementation(libs.moshi) + implementation(libs.retrofit.moshi) + implementation(libs.joda.time) + implementation(libs.retrofit) + implementation(libs.okhttp) + implementation(libs.okhttp.logging.interceptor) + implementation(libs.timber) + implementation(libs.easydeviceinfo.base) + implementation(libs.easydeviceinfo.common) - testImplementation("junit:junit:${Versions.junitVersion}") - testImplementation("org.assertj:assertj-core:${Versions.assertjVersion}") - testImplementation("org.mockito:mockito-core:${Versions.mockitoVersion}") - testImplementation("org.robolectric:robolectric:${Versions.robolectricVersion}") - testImplementation("org.robolectric:shadows-framework:${Versions.robolectricVersion}") - testImplementation("org.robolectric:shadowapi:${Versions.robolectricVersion}") - testImplementation("org.robolectric:shadows-playservices:${Versions.robolectricVersion}") - testImplementation("org.khronos:opengl-api:${Versions.openglApiVersion}") - testImplementation("androidx.test:core:1.4.0") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1") + testImplementation(libs.junit) + testImplementation(libs.assertj.core) + testImplementation(libs.mockito.core) + testImplementation(libs.robolectric) + testImplementation(libs.robolectric.shadows.framework) + testImplementation(libs.robolectric.shadows.api) + testImplementation(libs.robolectric.shadows.playservices) + testImplementation(libs.opengl.api) + testImplementation(libs.androidx.test.core) + testImplementation(libs.kotlin.coroutines.test) - testImplementation("com.github.stephanenicolas.toothpick:toothpick-testing:${Versions.toothPickVersion}") - kaptTest("com.github.stephanenicolas.toothpick:toothpick-compiler:${Versions.toothPickVersion}") + testImplementation(libs.toothpick.testing) + kaptTest(libs.toothpick.compiler) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..54971084 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,133 @@ +[versions] +appVersion = "3.0-M1" +annotationVersion = "1.9.1" +appcompatVersion = "1.3.1" +assertkJvmVersion = "0.24" +cardviewVersion = "1.0.0" +commonsIo = "2.6" +commonsLang3Version = "3.7" +compilerVersion = "4.12.0" +constraintlayoutVersion = "2.1.0" +firebaseBomVersion = "32.7.0" +flexboxVersion = "3.0.0" +fragmentKtxVersion = "1.4.0" +glide = "4.12.0" +junit = "1.2.1" +juniversalchardetVersion = "1.0.3" +kotlinVersion = "1.9.24" +kotlinCoroutinesVersion = "1.7.3" +androidPluginVersion = "8.5.0" +leanbackPreferenceVersion = "1.1.0-rc01" +leanbackVersion = "1.1.0-rc02" +legacySupportV4Version = "1.0.0" +materialVersion = "1.4.0" +minSdkVersion = "27" +mockwebserverVersion = "4.9.1" +moxy = "2.2.2" +moxyAppCompatVersion = "2.2.2" +moxyCompilerVersion = "2.2.2" +moxyKtxVersion = "2.2.2" +percentlayoutVersion = "1.0.0" +recyclerviewAnimatorsVersion = "4.0.2" +targetSdkVersion = "35" + +okhttpVersion = "4.10.0" +androidPriorityJobQueueVersion = "2.0.1" +eventBus = "3.1.1" +moshiKotlinVersion = "1.12.0" +retrofitVersion = "2.9.0" +jodaTimeVersion = "2.10.9.1" +timberVersion = "5.0.1" +exoplayerVersion = "2.17.1" +simpleXmlVersion = "2.7.1" + +junitVersion = "4.13.1" +assertjVersion = "3.11.1" +mockitoVersion = "5.14.2" +robolectricVersion = "4.14.1" +openglApiVersion = "gl1.1-android-2.1_r1" +assertJAndroidVersion = "1.1.1" +toothPickVersion = "3.1.0" +easydeviceInfoVersion = "2.4.1" + +androidxTestCoreVersion = "1.6.1" +androidxRecyclerViewVersion = "1.3.2" +resourcefulVersion = "1.1.0" + +[libraries] +androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "annotationVersion" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompatVersion" } +androidx-cardview = { module = "androidx.cardview:cardview", version.ref = "cardviewVersion" } +androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayoutVersion" } +androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtxVersion" } +androidx-fragment = { module = "androidx.fragment:fragment", version.ref = "fragmentKtxVersion" } +androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junit" } +androidx-leanback = { module = "androidx.leanback:leanback", version.ref = "leanbackVersion" } +androidx-leanback-preference = { module = "androidx.leanback:leanback-preference", version.ref = "leanbackPreferenceVersion" } +androidx-legacy-support-v4 = { module = "androidx.legacy:legacy-support-v4", version.ref = "legacySupportV4Version" } +androidx-percentlayout = { module = "androidx.percentlayout:percentlayout", version.ref = "percentlayoutVersion" } +androidx-recycler-view = { module = "androidx.recyclerview:recyclerview", version.ref = "androidxRecyclerViewVersion"} +assertk-jvm = { module = "com.willowtreeapps.assertk:assertk-jvm", version.ref = "assertkJvmVersion" } +commons-io = { module = "commons-io:commons-io", version.ref = "commonsIo" } +commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commonsLang3Version" } +exoplayer-core = { module = "com.google.android.exoplayer:exoplayer-core", version.ref = "exoplayerVersion"} +exoplayer-ui = { module = "com.google.android.exoplayer:exoplayer-ui", version.ref = "exoplayerVersion"} +exoplayer-okhttp = { module = "com.google.android.exoplayer:extension-okhttp", version.ref = "exoplayerVersion"} +firebase-analytics = { module = "com.google.firebase:firebase-analytics" } +firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebaseBomVersion" } +firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" } +github-glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } +github-glide-okhttp = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" } +glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "compilerVersion" } +flexbox = { module = "com.google.android.flexbox:flexbox", version.ref = "flexboxVersion" } +juniversalchardet = { module = "com.googlecode.juniversalchardet:juniversalchardet", version.ref = "juniversalchardetVersion" } +kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref="kotlinVersion" } +kotlin-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref="kotlinCoroutinesVersion" } +kotlin-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref="kotlinCoroutinesVersion" } + +android-priority-jobqueue = { group = "com.birbit", name = "android-priority-jobqueue", version.ref="androidPriorityJobQueueVersion" } +eventbus = { group = "org.greenrobot", name = "eventbus", version.ref = "eventBus"} +material = { module = "com.google.android.material:material", version.ref = "materialVersion" } +moxy-compiler = { module = "com.github.moxy-community:moxy-compiler", version.ref = "moxyCompilerVersion" } +okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "mockwebserverVersion" } +moshi = { group = "com.squareup.moshi", name = "moshi-kotlin", version.ref = "moshiKotlinVersion" } +moxy-community-moxy = { module = "com.github.moxy-community:moxy", version.ref = "moxy" } +moxy-community-moxy-app-compat = { module = "com.github.moxy-community:moxy-app-compat", version.ref = "moxyAppCompatVersion" } +moxy-ktx = { module = "com.github.moxy-community:moxy-ktx", version.ref = "moxyKtxVersion" } +okhttp-urlconnection = { module = "com.squareup.okhttp3:okhttp-urlconnection", version.ref = "okhttpVersion" } +recyclerview-animators = { module = "jp.wasabeef:recyclerview-animators", version.ref = "recyclerviewAnimatorsVersion" } +retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofitVersion" } +retrofit-moshi = { group = "com.squareup.retrofit2", name = "converter-moshi", version.ref = "retrofitVersion" } +joda-time = { group = "net.danlew", name = "android.joda", version.ref = "jodaTimeVersion" } +okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttpVersion" } +okhttp-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttpVersion" } +timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timberVersion" } +easydeviceinfo-base = { group = "com.github.nisrulz", name = "easydeviceinfo-base", version.ref = "easydeviceInfoVersion" } +easydeviceinfo-common = { group = "com.github.nisrulz", name = "easydeviceinfo-common", version.ref = "easydeviceInfoVersion" } +resourceful = { group = "com.github.rstanic12", name = "Resourceful", version.ref = "resourcefulVersion"} +simple-xml = { group = "org.simpleframework", name = "simple-xml", version.ref = "simpleXmlVersion" } + +# Toothpick +toothpick-runtime = { group = "com.github.stephanenicolas.toothpick", name = "toothpick-runtime", version.ref = "toothPickVersion"} +toothpick-smoothie = { group = "com.github.stephanenicolas.toothpick", name = "smoothie", version.ref = "toothPickVersion" } +toothpick-compiler = { group = "com.github.stephanenicolas.toothpick", name = "toothpick-compiler", version.ref = "toothPickVersion" } +toothpick-javax-annotations = { group = "com.github.stephanenicolas.toothpick", name = "toothpick-javax-annotations", version.ref = "toothPickVersion" } + +# Tests +junit = { group = "junit", name = "junit", version.ref = "junitVersion" } +assertj-core = { group = "org.assertj", name = "assertj-core", version.ref = "assertjVersion" } +assertj-android = { group = "com.squareup.assertj", name = "assertj-android", version.ref = "assertJAndroidVersion"} +mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockitoVersion" } +mockito-kotlin = { module = "com.nhaarman.mockitokotlin2:mockito-kotlin", version = "2.2.0"} +robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectricVersion" } +robolectric-shadows-framework = { group = "org.robolectric", name = "shadows-framework", version.ref = "robolectricVersion" } +robolectric-shadows-api = { group = "org.robolectric", name = "shadowapi", version.ref = "robolectricVersion" } +robolectric-shadows-playservices = { group = "org.robolectric", name = "shadows-playservices", version.ref = "robolectricVersion" } +opengl-api = { group = "org.khronos", name = "opengl-api", version.ref="openglApiVersion" } + +androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidxTestCoreVersion" } +kotlin-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinCoroutinesVersion" } + +toothpick-testing = { group = "com.github.stephanenicolas.toothpick", name = "toothpick-testing", version.ref = "toothPickVersion"} + +[plugins] diff --git a/manager/build.gradle.kts b/manager/build.gradle.kts index 19762b8e..038f9f56 100644 --- a/manager/build.gradle.kts +++ b/manager/build.gradle.kts @@ -10,11 +10,11 @@ android { buildConfig = true } defaultConfig { - minSdkVersion(Versions.minSdkVersion) - targetSdkVersion(Versions.targetSdkVersion) + minSdkVersion(libs.versions.minSdkVersion.get()) + targetSdkVersion(libs.versions.targetSdkVersion.get()) } - compileSdkVersion(Versions.targetSdkVersion) + compileSdk = libs.versions.targetSdkVersion.get().toInt() testOptions { unitTests { isIncludeAndroidResources = true @@ -41,10 +41,10 @@ android { } dependencies { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1") + implementation(libs.kotlin) + implementation(libs.kotlin.coroutines.android) + implementation(libs.kotlin.coroutines.core) - api("com.squareup.retrofit2:retrofit:${Versions.retrofitVersion}") + api(libs.retrofit) // compileOnly("com.squareup.okhttp3:okhttp:${Versions.okhttpVersion}") } diff --git a/serenity-android-common/build.gradle.kts b/serenity-android-common/build.gradle.kts index 0558aec4..ccaa3711 100644 --- a/serenity-android-common/build.gradle.kts +++ b/serenity-android-common/build.gradle.kts @@ -7,11 +7,11 @@ plugins { android { namespace = "us.nineworlds.serenity.common.android" - compileSdkVersion(Versions.targetSdkVersion) + compileSdk = libs.versions.targetSdkVersion.get().toInt() defaultConfig { - minSdkVersion(Versions.minSdkVersion) - targetSdkVersion(Versions.targetSdkVersion) + minSdkVersion(libs.versions.minSdkVersion.get()) + targetSdkVersion(libs.versions.targetSdkVersion.get()) } compileOptions { @@ -40,34 +40,32 @@ android { dependencies { api(project(":serenity-common")) - api("org.greenrobot:eventbus:${Versions.eventBus}") - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}") - api("com.birbit:android-priority-jobqueue:${Versions.androidPriorityJobQueueVersion}") + api(libs.eventbus) + implementation(libs.kotlin) + api(libs.android.priority.jobqueue) - releaseApi("com.github.stephanenicolas.toothpick:toothpick-runtime:${Versions.toothPickVersion}") { + releaseApi(libs.toothpick.runtime) { exclude(group = "javax.inject") } - releaseApi("com.github.stephanenicolas.toothpick:smoothie:${Versions.toothPickVersion}") { + releaseApi(libs.toothpick.smoothie) { exclude(group = "javax.inject") } - debugApi("com.github.stephanenicolas.toothpick:toothpick-runtime:${Versions.toothPickVersion}") - debugApi("com.github.stephanenicolas.toothpick:smoothie:${Versions.toothPickVersion}") + debugApi(libs.toothpick.runtime) + debugApi(libs.toothpick.smoothie) - releaseApi("com.github.stephanenicolas.toothpick:toothpick-javax-annotations:${Versions.toothPickVersion}") - kapt("com.github.stephanenicolas.toothpick:toothpick-compiler:${Versions.toothPickVersion}") + releaseApi(libs.toothpick.javax.annotations) + kapt(libs.toothpick.compiler) - testImplementation("junit:junit:${Versions.junitVersion}") - testImplementation("org.assertj:assertj-core:${Versions.assertjVersion}") - testImplementation("org.mockito:mockito-core:${Versions.mockitoVersion}") - testImplementation("org.robolectric:robolectric:${Versions.robolectricVersion}") { - exclude(module = "support-v4") - } - testImplementation("org.robolectric:shadows-framework:${Versions.robolectricVersion}") - testImplementation("org.robolectric:shadowapi:${Versions.robolectricVersion}") - testImplementation("org.robolectric:shadows-playservices:${Versions.robolectricVersion}") - testImplementation("org.khronos:opengl-api:${Versions.openglApiVersion}") + testImplementation(libs.junit) + testImplementation(libs.assertj.core) + testImplementation(libs.mockito.core) + testImplementation(libs.robolectric) + testImplementation(libs.robolectric.shadows.framework) + testImplementation(libs.robolectric.shadows.api) + testImplementation(libs.robolectric.shadows.playservices) + testImplementation(libs.opengl.api) - testImplementation("com.github.stephanenicolas.toothpick:toothpick-testing:${Versions.toothPickVersion}") - kaptTest("com.github.stephanenicolas.toothpick:toothpick-compiler:${Versions.toothPickVersion}") + testImplementation(libs.toothpick.testing) + kaptTest(libs.toothpick.compiler) } diff --git a/serenity-app/build.gradle.kts b/serenity-app/build.gradle.kts index 96c23889..66e6b137 100644 --- a/serenity-app/build.gradle.kts +++ b/serenity-app/build.gradle.kts @@ -34,8 +34,8 @@ android { defaultConfig { versionCode = 3000000 versionName = "3.0.0-M1" - minSdk = Versions.minSdkVersion - targetSdk = Versions.targetSdkVersion + minSdk = libs.versions.minSdkVersion.get().toInt() + targetSdk = libs.versions.targetSdkVersion.get().toInt() multiDexEnabled = true multiDexKeepProguard = file("multidex_keep_file.txt") @@ -49,7 +49,7 @@ android { getByName("test").java.srcDirs("src/test/kotlin", "src/test/java") } - compileSdk = Versions.targetSdkVersion + compileSdk = libs.versions.targetSdkVersion.get().toInt() if (project.hasProperty("keystore")) { signingConfigs { @@ -113,122 +113,118 @@ tasks.withType { dependencies { - implementation(platform("com.google.firebase:firebase-bom:32.7.0")) + implementation(platform(libs.firebase.bom)) implementation(project(":subtitle-converter")) implementation(project(":emby-lib")) implementation(project(":serenity-android-common")) implementation(project(":serenity-common")) - implementation("androidx.recyclerview:recyclerview:1.2.1") { - version { - strictly("1.2.1") - } - } + implementation(libs.androidx.recycler.view) - implementation("com.google.firebase:firebase-analytics") - implementation("com.google.firebase:firebase-crashlytics") + implementation(libs.firebase.analytics) + implementation(libs.firebase.crashlytics) - implementation(group = "com.github.bumptech.glide", name = "okhttp3-integration", version = "${Versions.glideOkHttpVersion}") - implementation("com.google.android.exoplayer:exoplayer-core:${Versions.exoplayerVersion}") { + implementation(libs.github.glide.okhttp) + implementation(libs.exoplayer.core) { exclude(module = "support-annotations") } - implementation("com.google.android.exoplayer:exoplayer-ui:${Versions.exoplayerVersion}") { + implementation(libs.exoplayer.ui) { exclude(module = "support-annotations") } - implementation("com.google.android.exoplayer:extension-okhttp:${Versions.exoplayerVersion}") { + implementation(libs.exoplayer.okhttp) { exclude(module = "support-annotations") } - implementation("com.squareup.okhttp3:okhttp:${Versions.okhttpVersion}") { + implementation(libs.okhttp) { exclude(group = "com.android.support") } - implementation("androidx.fragment:fragment-ktx:1.4.0") - implementation("com.google.android.material:material:1.4.0") - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") - implementation("com.github.moxy-community:moxy:${Versions.moxyVersion}") - implementation("com.github.moxy-community:moxy-app-compat:${Versions.moxyVersion}") - implementation("com.github.moxy-community:moxy-ktx:${Versions.moxyVersion}") - implementation("com.github.bumptech.glide:glide:${Versions.glideVersion}") - kapt("com.github.bumptech.glide:compiler:${Versions.glideVersion}") - implementation("com.birbit:android-priority-jobqueue:${Versions.androidPriorityJobQueueVersion}") - implementation("androidx.appcompat:appcompat:1.3.1") - implementation("androidx.leanback:leanback:1.1.0-rc02") - implementation("androidx.leanback:leanback-preference:1.1.0-rc01") - implementation("androidx.legacy:legacy-support-v4:1.0.0") - implementation("androidx.constraintlayout:constraintlayout:2.1.0") - implementation("androidx.percentlayout:percentlayout:1.0.0") - implementation("androidx.annotation:annotation:1.2.0") - implementation("com.googlecode.juniversalchardet:juniversalchardet:${Versions.universalCharDetVersion}") - implementation("com.squareup.okhttp3:logging-interceptor:${Versions.okhttpVersion}") + implementation(libs.androidx.fragment.ktx) + implementation(libs.material) + implementation(libs.kotlin) + implementation(libs.kotlin.coroutines.android) + implementation(libs.moxy.community.moxy) + implementation(libs.moxy.community.moxy.app.compat) + implementation(libs.moxy.ktx) + implementation(libs.github.glide) + kapt(libs.glide.compiler) + implementation(libs.android.priority.jobqueue) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.leanback) + implementation(libs.androidx.leanback.preference) + implementation(libs.androidx.legacy.support.v4) + implementation(libs.androidx.constraintlayout) + implementation(libs.androidx.percentlayout) + implementation(libs.androidx.annotation) + implementation(libs.juniversalchardet) + implementation(libs.okhttp.logging.interceptor) implementation(project(":manager")) - implementation("com.squareup.okhttp3:okhttp-urlconnection:${Versions.okhttpVersion}") - implementation("com.jakewharton.timber:timber:${Versions.timberVersion}") - implementation("androidx.cardview:cardview:1.0.0") - implementation("androidx.annotation:annotation:1.2.0") + implementation(libs.okhttp.urlconnection) + implementation(libs.timber) + implementation(libs.androidx.cardview) + implementation(libs.androidx.annotation) - releaseImplementation("com.github.stephanenicolas.toothpick:toothpick-runtime:${Versions.toothPickVersion}") { + releaseImplementation(libs.toothpick.runtime) { exclude(group = "javax.inject") } - releaseImplementation("com.github.stephanenicolas.toothpick:smoothie:${Versions.toothPickVersion}") { + releaseImplementation(libs.toothpick.smoothie) { exclude(group = "javax.inject") } - debugImplementation("com.github.stephanenicolas.toothpick:toothpick-runtime:${Versions.toothPickVersion}") + debugImplementation(libs.toothpick.runtime) - releaseImplementation("com.github.stephanenicolas.toothpick:toothpick-javax-annotations:${Versions.toothPickVersion}") - kapt("com.github.stephanenicolas.toothpick:toothpick-compiler:${Versions.toothPickVersion}") + releaseImplementation(libs.toothpick.javax.annotations) + kapt(libs.toothpick.compiler) - implementation("com.squareup.moshi:moshi-kotlin:${Versions.moshiKotlinVersion}") - implementation("com.squareup.retrofit2:converter-moshi:${Versions.retrofitVersion}") - implementation("net.danlew:android.joda:${Versions.jodaTimeVersion}") - implementation("com.squareup.retrofit2:retrofit:${Versions.retrofitVersion}") - implementation("com.google.android.flexbox:flexbox:3.0.0") + implementation(libs.moshi) + implementation(libs.retrofit.moshi) + implementation(libs.joda.time) + implementation(libs.retrofit) + implementation(libs.flexbox) //implementation("com.henryblue.library:tvrecyclerview:1.2.2") - implementation("jp.wasabeef:recyclerview-animators:4.0.2") + implementation(libs.recyclerview.animators) - implementation("com.github.rstanic12:Resourceful:1.1.0") { + implementation(libs.resourceful) { exclude(group = "com.google.guava") } // https://mvnrepository.com/artifact/org.simpleframework/simple-xml - implementation("org.simpleframework:simple-xml:${Versions.simpleXmlVersion}") { + implementation(libs.simple.xml) { exclude(group = "stax") exclude(group = "xpp3") } - testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") - testImplementation("org.apache.commons:commons-lang3:${Versions.commonsLangVersion}") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.commons.lang3) + testImplementation(libs.kotlin.coroutines.test) - testImplementation("com.squareup.okhttp3:mockwebserver:${Versions.okhttpVersion}") - testImplementation("commons-io:commons-io:${Versions.commonsioVersion}") - testImplementation("com.github.stephanenicolas.toothpick:toothpick-testing:${Versions.toothPickVersion}") - testImplementation("org.robolectric:robolectric:${Versions.robolectricVersion}") { + testImplementation(libs.okhttp.mockwebserver) + testImplementation(libs.commons.io) + testImplementation(libs.toothpick.testing) + testImplementation(libs.robolectric) { exclude(module = "support-v4") } - testImplementation("com.squareup.assertj:assertj-android:${Versions.assertJAndroidVersion}") { + testImplementation(libs.assertj.android) { exclude(module = "support-v4") exclude(module = "support-annotations") } - testImplementation("com.willowtreeapps.assertk:assertk-jvm:${Versions.assertkVersion}") - testImplementation("org.assertj:assertj-core:${Versions.assertjVersion}") - testImplementation("junit:junit:${Versions.junitVersion}") - testImplementation("org.robolectric:shadows-framework:${Versions.robolectricVersion}@jar") - testImplementation("org.robolectric:shadowapi:${Versions.robolectricVersion}") - testImplementation("org.robolectric:shadows-playservices:${Versions.robolectricVersion}") - testImplementation("androidx.test:core:1.4.0") - testImplementation("org.khronos:opengl-api:${Versions.openglApiVersion}") - testImplementation("org.mockito:mockito-core:${Versions.mockitoVersion}") - testImplementation("androidx.test.ext:junit:1.1.3") + testImplementation(libs.assertk.jvm) + testImplementation(libs.assertj.core) + testImplementation(libs.junit) + testImplementation(libs.robolectric.shadows.framework) + testImplementation(libs.robolectric.shadows.api) + testImplementation(libs.robolectric.shadows.playservices) + testImplementation(libs.androidx.test.core) + testImplementation(libs.opengl.api) + testImplementation(libs.androidx.junit) - kaptTest("com.github.stephanenicolas.toothpick:toothpick-compiler:${Versions.toothPickVersion}") + kaptTest(libs.toothpick.compiler) - kapt("com.github.moxy-community:moxy-compiler:${Versions.moxyVersion}") + kapt(libs.moxy.compiler) } //com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true @@ -236,6 +232,6 @@ dependencies { configurations.all { resolutionStrategy { - force("androidx.fragment:fragment:1.4.0") + force(libs.androidx.fragment) } } \ No newline at end of file diff --git a/serenity-common/build.gradle.kts b/serenity-common/build.gradle.kts index f5fd08b0..f58a5b4c 100644 --- a/serenity-common/build.gradle.kts +++ b/serenity-common/build.gradle.kts @@ -15,16 +15,16 @@ java { dependencies { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}") + implementation(libs.kotlin) - implementation("com.squareup.okhttp3:okhttp:${Versions.okhttpVersion}") - implementation("com.squareup.okhttp3:logging-interceptor:${Versions.okhttpVersion}") - implementation("androidx.annotation:annotation:1.2.0") + implementation(libs.okhttp) + implementation(libs.okhttp.logging.interceptor) + implementation(libs.androidx.annotation) - implementation("com.github.stephanenicolas.toothpick:toothpick-runtime:${Versions.toothPickVersion}") { + implementation(libs.toothpick.runtime) { exclude(group = "javax.inject") } - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1") + implementation(libs.kotlin.coroutines.android) } diff --git a/subtitle-converter/build.gradle b/subtitle-converter/build.gradle deleted file mode 100644 index e4f39b26..00000000 --- a/subtitle-converter/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -apply plugin: 'java' - -targetCompatibility = '1.8' -sourceCompatibility = '1.8' - -dependencies { - testImplementation "junit:junit:$Versions.junitVersion" -} diff --git a/subtitle-converter/build.gradle.kts b/subtitle-converter/build.gradle.kts new file mode 100644 index 00000000..515aa6b2 --- /dev/null +++ b/subtitle-converter/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + java +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + testImplementation(libs.junit) +}