Skip to content

Commit

Permalink
211 version catalog migration (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ authored Aug 23, 2023
1 parent 5e48aa3 commit 209b000
Show file tree
Hide file tree
Showing 17 changed files with 202 additions and 307 deletions.
17 changes: 8 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
import io.gitlab.arturbosch.detekt.Detekt
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.0" apply false
id("com.android.library") version "8.1.0" apply false
id("org.jetbrains.kotlin.kapt") version "1.9.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
// https://github.com/detekt/detekt
id("io.gitlab.arturbosch.detekt").version(Version.detetk)
// known bug for libs : https://developer.android.com/studio/preview/features#gradle-version-catalogs-known-issues
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.detekt)
}

apply(plugin = "android-reporting")

allprojects {

apply(plugin = "io.gitlab.arturbosch.detekt")
// Official site : https://detekt.dev/docs/gettingstarted/gradle
// Tutorial : https://medium.com/@nagendran.p/integrating-detekt-in-the-android-studio-442128e971f8
Expand All @@ -30,8 +29,8 @@ allprojects {
}

dependencies {
detekt(Dependencies.Detekt.detektCli)
detektPlugins(Dependencies.Detekt.detektFormatting)
detekt(libs.detekt.cli)
detektPlugins(libs.detekt.formatting)
}

tasks.withType<Detekt>().configureEach {
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/java/AppConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ object AppConfig {
const val minSdk = 21
const val targetSdk = 33
const val compileSdk = 34
// https://developer.android.com/jetpack/androidx/releases/compose-kotlin
const val composeCompiler = "1.5.1"

@Suppress("SimpleDateFormat")
fun getBuildDate(): String {
Expand Down
131 changes: 0 additions & 131 deletions buildSrc/src/main/java/Dependencies.kt

This file was deleted.

88 changes: 88 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[versions]
accompanist = "0.33.0-alpha"
activityCompose = "1.7.2"
androidGradlePlugin = "8.1.1"
dataProvider = "0.4.0"
kotlinPlugin = "1.9.0"
detekt = "1.22.0" # https://github.com/detekt/detekt
ktx = "1.10.1"
coroutines = "1.6.4"
# Downgrade mockk to 1.12.5 because of duplicate files with androidTest
# https://stackoverflow.com/questions/75150167/instrumented-tests-will-not-run-6-files-found-with-path-meta-inf-license-md
lifecycleViewmodelCompose = "2.6.1"
mockk = "1.12.5"
junit = "4.13.2"
androidJunit = "1.1.5"
espresso = "3.5.1"
media3 = "1.1.0"
media = "1.6.0"
guava = "31.1-android"
navigationCompose = "2.7.0"
pagingCompose = "3.2.0"
retrofit = "2.9.0"
moshi = "1.15.0"
okhttp = "4.9.1"
glide = "4.14.2"
# TagCommander : https://github.com/CommandersAct/AndroidV5
tagCommanderCore = "5.3.2"
tagCommanderServerSide = "5.4.2"
# ComScore : https://github.com/comScore/ComScore-Android
comscore = "6.9.3"
androidxComposeBom = "2023.08.00"

[libraries]
accompanist-navigation-material = { module = "com.google.accompanist:accompanist-navigation-material", version.ref = "accompanist" }
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
androidx-paging-compose = { module = "androidx.paging:paging-compose", version.ref = "pagingCompose" }
srg-data = { module = "ch.srg.data.provider:data", version.ref = "dataProvider" }
srg-dataprovider-paging = { module = "ch.srg.data.provider:dataprovider-paging", version.ref = "dataProvider" }
srg-dataprovider-retrofit = { module = "ch.srg.data.provider:dataprovider-retrofit", version.ref = "dataProvider" }
detekt-cli = { group = "io.gitlab.arturbosch.detekt", name="detekt-cli", version.ref = "detekt" }
detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-test-junit = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "androidJunit" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" }
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
mockk-android = { group = "io.mockk", name = "mockk-android", version.ref = "mockk" }
kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "coroutines" }
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-guava = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-guava", version.ref = "coroutines" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "media3" }
androidx-media3-ui = { group = "androidx.media3", name = "media3-ui", version.ref = "media3" }
androidx-media3-dash = { group = "androidx.media3", name = "media3-exoplayer-dash", version.ref = "media3" }
androidx-media3-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "media3" }
androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" }
androidx-media = { group = "androidx.media", name = "media", version.ref = "media" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
retrofit-converter-moshi = { group = "com.squareup.retrofit2", name = "converter-moshi", version.ref = "retrofit" }
okhttp-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" }
moshi = { group = "com.squareup.moshi", name = "moshi", version.ref = "moshi" }
moshi-kotlin-codegen = { group = "com.squareup.moshi", name = "moshi-kotlin-codegen", version.ref = "moshi" }
glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" }
glide-compiler = { group = "com.github.bumptech.glide", name = "compiler", version.ref = "glide" }
tagcommander-core = { group = "com.tagcommander.lib", name = "core", version.ref = "tagCommanderCore" }
tagcommander-serverside = { group = "com.tagcommander.lib", name = "ServerSide", version.ref = "tagCommanderServerSide" }
comscore = { group = "com.comscore", name = "android-analytics", version.ref = "comscore" }
# Compose
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" }
androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlinPlugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinPlugin" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
24 changes: 11 additions & 13 deletions pillarbox-analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* License information is available from the LICENSE file.
*/
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
`maven-publish`
}

Expand Down Expand Up @@ -54,19 +54,17 @@ android {
}

dependencies {
implementation(Dependencies.AndroidX.core)
implementation(libs.androidx.ktx)

api(Dependencies.CommandersAct.tagcommanderCore)
api(Dependencies.CommandersAct.tagcommanderServerSide)
api(Dependencies.Comscore.analytis)
implementation(Dependencies.AndroidX.lifecycleRuntime)
implementation(Dependencies.AndroidX.lifecycleProcess)
api(libs.tagcommander.core)
api(libs.tagcommander.serverside)
api(libs.comscore)

testImplementation(Dependencies.Test.junit)
testImplementation(Dependencies.Coroutines.test)
androidTestImplementation(Dependencies.Test.androidJunit)
androidTestImplementation(Dependencies.Test.espressoCore)
androidTestImplementation(Dependencies.Coroutines.test)
testImplementation(libs.junit)
testImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.kotlinx.coroutines.test)
}

publishing {
Expand Down
32 changes: 16 additions & 16 deletions pillarbox-core-business/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* License information is available from the LICENSE file.
*/
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.kapt")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.kapt)
`maven-publish`
}

Expand Down Expand Up @@ -55,21 +55,21 @@ dependencies {
api(project(mapOf("path" to ":pillarbox-player")))
api(project(mapOf("path" to ":pillarbox-analytics")))

implementation(Dependencies.Coroutines.android)
implementation(Dependencies.AndroidX.core)
api(Dependencies.Square.retrofit)
implementation(Dependencies.Square.moshi)
kapt(Dependencies.Square.moshiKotlinCodegen)
implementation(Dependencies.Square.converterMoshi)
implementation(Dependencies.Square.loggingInterceptor)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.androidx.ktx)
api(libs.retrofit)
implementation(libs.moshi)
kapt(libs.moshi.kotlin.codegen)
implementation(libs.retrofit.converter.moshi)
implementation(libs.okhttp.logging.interceptor)

testImplementation(Dependencies.Test.junit)
testImplementation(Dependencies.Test.mockk)
testImplementation(libs.junit)
testImplementation(libs.mockk)
testImplementation(project(mapOf("path" to ":pillarbox-player-testutils")))
androidTestImplementation(Dependencies.Test.androidJunit)
androidTestImplementation(Dependencies.Test.espressoCore)
androidTestImplementation(Dependencies.Test.mockkAndroid)
androidTestImplementation(Dependencies.Coroutines.test)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.mockk.android)
androidTestImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(project(mapOf("path" to ":pillarbox-player-testutils")))
}

Expand Down
Loading

0 comments on commit 209b000

Please sign in to comment.