From 34346150a76f0b1e157c5f523164acc87505b772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 15:18:04 +0200 Subject: [PATCH 01/18] Update compile SDK and target SDK to 34 --- buildSrc/src/main/kotlin/Config.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/Config.kt b/buildSrc/src/main/kotlin/Config.kt index ca6aa36..cc5ebe8 100644 --- a/buildSrc/src/main/kotlin/Config.kt +++ b/buildSrc/src/main/kotlin/Config.kt @@ -1,6 +1,6 @@ object Config { - const val compileSdk = 33 - const val targetSdk = 33 + const val compileSdk = 34 + const val targetSdk = 34 const val minSdk = 21 const val major = 0 From 7a0642ce658926c795aba26bb08cd68c895307c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 15:25:48 +0200 Subject: [PATCH 02/18] Update Android Gradle Plugin to 8.5.2 --- data/build.gradle.kts | 2 +- dataprovider-paging/build.gradle.kts | 2 +- dataprovider-retrofit/build.gradle.kts | 2 +- gradle.properties | 5 ----- gradle/libs.versions.toml | 6 +++--- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/data/build.gradle.kts b/data/build.gradle.kts index 67b77fc..fa6761d 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -11,7 +11,6 @@ android { defaultConfig { minSdk = Config.minSdk - targetSdk = Config.targetSdk group = Config.maven_group version = Config.versionName testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -42,6 +41,7 @@ android { abortOnError = false sarifReport = true sarifOutput = rootProject.layout.buildDirectory.file("reports/android-lint/${project.name}.sarif").get().asFile + targetSdk = Config.targetSdk } publishing { singleVariant("release") { diff --git a/dataprovider-paging/build.gradle.kts b/dataprovider-paging/build.gradle.kts index 6e006c6..6c2e5b7 100644 --- a/dataprovider-paging/build.gradle.kts +++ b/dataprovider-paging/build.gradle.kts @@ -10,7 +10,6 @@ android { defaultConfig { minSdk = Config.minSdk - targetSdk = Config.targetSdk group = Config.maven_group version = Config.versionName testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -41,6 +40,7 @@ android { abortOnError = false sarifReport = true sarifOutput = rootProject.layout.buildDirectory.file("reports/android-lint/${project.name}.sarif").get().asFile + targetSdk = Config.targetSdk } publishing { singleVariant("release") { diff --git a/dataprovider-retrofit/build.gradle.kts b/dataprovider-retrofit/build.gradle.kts index cab7109..65103bb 100644 --- a/dataprovider-retrofit/build.gradle.kts +++ b/dataprovider-retrofit/build.gradle.kts @@ -10,7 +10,6 @@ android { defaultConfig { minSdk = Config.minSdk - targetSdk = Config.targetSdk group = Config.maven_group version = Config.versionName testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -41,6 +40,7 @@ android { abortOnError = false sarifReport = true sarifOutput = rootProject.layout.buildDirectory.file("reports/android-lint/${project.name}.sarif").get().asFile + targetSdk = Config.targetSdk } publishing { singleVariant("release") { diff --git a/gradle.properties b/gradle.properties index 397bf7e..f20a521 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,8 +17,3 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 android.useAndroidX=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official -# Enables namespacing of each library's R class so that its R class includes only the -# resources declared in the library itself and none from the library's dependencies, -# thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true -android.nonFinalResIds=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 50eff3f..2134142 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -androidGradlePlugin = "8.1.1" +android-gradle-plugin = "8.5.2" androidx-junit = "1.1.5" androidx-annotation = "1.3.0" appcompat = "1.6.1" @@ -34,8 +34,8 @@ robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectr androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } [plugins] -android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } -android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } +android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinPlugin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinPlugin" } From 074abb84988c4a941ecfd24e2b8cb1ff0ed65441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 15:29:02 +0200 Subject: [PATCH 03/18] Update AndroidX Test Ext jUnit --- data/build.gradle.kts | 2 +- dataprovider-retrofit/build.gradle.kts | 2 +- gradle/libs.versions.toml | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/data/build.gradle.kts b/data/build.gradle.kts index fa6761d..7e05f61 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -56,7 +56,7 @@ dependencies { testImplementation(libs.robolectric) testImplementation(libs.junit) - testImplementation(libs.ext.junit) + testImplementation(libs.androidx.test.ext.junit) } publishing { diff --git a/dataprovider-retrofit/build.gradle.kts b/dataprovider-retrofit/build.gradle.kts index 65103bb..7c91e12 100644 --- a/dataprovider-retrofit/build.gradle.kts +++ b/dataprovider-retrofit/build.gradle.kts @@ -59,7 +59,7 @@ dependencies { testImplementation(libs.junit) testRuntimeOnly(libs.robolectric) - testImplementation(libs.ext.junit) + testImplementation(libs.androidx.test.ext.junit) } publishing { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2134142..f283be3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,7 @@ [versions] android-gradle-plugin = "8.5.2" -androidx-junit = "1.1.5" +androidx-test-ext-junit = "1.2.1" + androidx-annotation = "1.3.0" appcompat = "1.6.1" constraintlayout = "2.1.4" @@ -17,9 +18,10 @@ retrofit2KotlinxSerializationConverter = "1.0.0" robolectric = "4.11.1" [libraries] +androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } + appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } -ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" } junit = { module = "junit:junit", version.ref = "junit" } lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel" } lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle-viewmodel" } From 50cf915e1a386fcde8f617281e42cec7c2d9a0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 15:35:17 +0200 Subject: [PATCH 04/18] Update AndroidX Annotation --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f283be3..d37beb1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] android-gradle-plugin = "8.5.2" +androidx-annotation = "1.8.2" androidx-test-ext-junit = "1.2.1" -androidx-annotation = "1.3.0" appcompat = "1.6.1" constraintlayout = "2.1.4" detekt = "1.22.0" @@ -18,6 +18,7 @@ retrofit2KotlinxSerializationConverter = "1.0.0" robolectric = "4.11.1" [libraries] +androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } @@ -33,7 +34,6 @@ detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-form kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } retrofit2-kotlinx-serialization-converter = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version.ref = "retrofit2KotlinxSerializationConverter" } robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } -androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } [plugins] android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } From c8e53322022e951f40a9f828d32e9c3d06c10cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 15:44:08 +0200 Subject: [PATCH 05/18] Replace AndroidX Appcompat with AndroidX Activity --- dataproviderdemo/build.gradle.kts | 2 +- .../main/java/ch/srgssr/dataprovider/demo/MainActivity.kt | 8 +++++--- gradle/libs.versions.toml | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dataproviderdemo/build.gradle.kts b/dataproviderdemo/build.gradle.kts index 0520cbe..bde3683 100644 --- a/dataproviderdemo/build.gradle.kts +++ b/dataproviderdemo/build.gradle.kts @@ -57,7 +57,7 @@ android { dependencies { implementation(project(":dataprovider-retrofit")) - implementation(libs.appcompat) + implementation(libs.androidx.activity) implementation(libs.material) implementation(libs.constraintlayout) implementation(libs.lifecycle.runtime) diff --git a/dataproviderdemo/src/main/java/ch/srgssr/dataprovider/demo/MainActivity.kt b/dataproviderdemo/src/main/java/ch/srgssr/dataprovider/demo/MainActivity.kt index a377463..7161d52 100644 --- a/dataproviderdemo/src/main/java/ch/srgssr/dataprovider/demo/MainActivity.kt +++ b/dataproviderdemo/src/main/java/ch/srgssr/dataprovider/demo/MainActivity.kt @@ -2,7 +2,8 @@ package ch.srgssr.dataprovider.demo import android.os.Bundle import android.util.Log -import androidx.appcompat.app.AppCompatActivity +import androidx.activity.ComponentActivity +import androidx.activity.enableEdgeToEdge import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle @@ -16,14 +17,15 @@ import kotlinx.coroutines.flow.flow import kotlinx.coroutines.launch import okhttp3.OkHttpClient -class MainActivity : AppCompatActivity() { +class MainActivity : ComponentActivity(R.layout.activity_main) { private lateinit var okHttp: OkHttpClient private lateinit var ilService: IlService override fun onCreate(savedInstanceState: Bundle?) { + enableEdgeToEdge() + super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) okHttp = OkHttpModule.createOkHttpClient(this) ilService = IlServiceModule.createIlService(okHttp, ilHost = IlHost.PROD) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d37beb1..fb065ea 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,9 @@ [versions] android-gradle-plugin = "8.5.2" +androidx-activity = "1.9.1" androidx-annotation = "1.8.2" androidx-test-ext-junit = "1.2.1" -appcompat = "1.6.1" constraintlayout = "2.1.4" detekt = "1.22.0" junit = "4.13.2" @@ -18,10 +18,10 @@ retrofit2KotlinxSerializationConverter = "1.0.0" robolectric = "4.11.1" [libraries] +androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx-activity" } androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } -appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } junit = { module = "junit:junit", version.ref = "junit" } lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel" } From 3738847521411b382c76a1a49d20e94e2fdff777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 15:47:33 +0200 Subject: [PATCH 06/18] Remove unneeded AndroidX ConstraintLayout dependency --- dataproviderdemo/build.gradle.kts | 1 - .../src/main/res/layout/activity_main.xml | 13 ++++--------- gradle/libs.versions.toml | 2 -- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dataproviderdemo/build.gradle.kts b/dataproviderdemo/build.gradle.kts index bde3683..9b8c2be 100644 --- a/dataproviderdemo/build.gradle.kts +++ b/dataproviderdemo/build.gradle.kts @@ -59,7 +59,6 @@ dependencies { implementation(project(":dataprovider-retrofit")) implementation(libs.androidx.activity) implementation(libs.material) - implementation(libs.constraintlayout) implementation(libs.lifecycle.runtime) implementation(libs.lifecycle.viewmodel) } diff --git a/dataproviderdemo/src/main/res/layout/activity_main.xml b/dataproviderdemo/src/main/res/layout/activity_main.xml index 4fc2444..5e8e3dd 100644 --- a/dataproviderdemo/src/main/res/layout/activity_main.xml +++ b/dataproviderdemo/src/main/res/layout/activity_main.xml @@ -1,6 +1,5 @@ - - - \ No newline at end of file + android:layout_gravity="center" + android:text="Hello World!" /> + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fb065ea..990e3ab 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,6 @@ androidx-activity = "1.9.1" androidx-annotation = "1.8.2" androidx-test-ext-junit = "1.2.1" -constraintlayout = "2.1.4" detekt = "1.22.0" junit = "4.13.2" kotlinPlugin = "1.9.10" @@ -22,7 +21,6 @@ androidx-activity = { module = "androidx.activity:activity", version.ref = "andr androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } -constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } junit = { module = "junit:junit", version.ref = "junit" } lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel" } lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle-viewmodel" } From 552b929d355b57f8f87eefcbee8eb51f64a56849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 16:01:27 +0200 Subject: [PATCH 07/18] Update Detekt --- config/detekt.yml | 12 +++--------- .../srgssr/dataprovider/paging/DataProviderPaging.kt | 4 +++- .../integrationlayer/request/IlStatisticService.kt | 10 ++++++++-- gradle/libs.versions.toml | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/config/detekt.yml b/config/detekt.yml index c62f268..4ac71c5 100644 --- a/config/detekt.yml +++ b/config/detekt.yml @@ -300,7 +300,6 @@ naming: BooleanPropertyNaming: active: false allowedPattern: '^(is|has|are)' - ignoreOverridden: true ClassNaming: active: true classPattern: '[A-Z][a-zA-Z0-9]*' @@ -309,7 +308,6 @@ naming: parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true EnumNaming: active: true enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' @@ -327,13 +325,11 @@ naming: excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] functionPattern: '[a-z][a-zA-Z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true ignoreAnnotated: [ 'Composable' ] FunctionParameterNaming: active: true parameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true InvalidPackageDeclaration: active: true rootPackage: '' @@ -375,7 +371,6 @@ naming: variablePattern: '[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true performance: active: true @@ -515,12 +510,11 @@ style: includeLineWrapping: false ForbiddenComment: active: true - values: + comments: - 'FIXME:' - 'STOPSHIP:' - 'TODO:' allowedPatterns: '' - customMessage: '' ForbiddenImport: active: false imports: [ ] @@ -564,7 +558,7 @@ style: ignoreRanges: false ignoreExtensionFunctions: true ignoreAnnotated: [ 'Composable' ] - MandatoryBracesIfStatements: + BracesOnIfStatements: active: false MandatoryBracesLoops: active: false @@ -597,7 +591,7 @@ style: active: true OptionalUnit: active: false - OptionalWhenBraces: + BracesOnWhenStatements: active: false PreferToOverPairSyntax: active: false diff --git a/dataprovider-paging/src/main/java/ch/srgssr/dataprovider/paging/DataProviderPaging.kt b/dataprovider-paging/src/main/java/ch/srgssr/dataprovider/paging/DataProviderPaging.kt index a1101af..7fb8e0e 100644 --- a/dataprovider-paging/src/main/java/ch/srgssr/dataprovider/paging/DataProviderPaging.kt +++ b/dataprovider-paging/src/main/java/ch/srgssr/dataprovider/paging/DataProviderPaging.kt @@ -256,7 +256,9 @@ class DataProviderPaging( fun getRadioAlphabeticalShowsByChannelId(bu: Bu, radioChannelId: String, pageSize: Int = DEFAULT_PAGE_SIZE): Flow> { return createNextUrlPagingData( pageSize = pageSize, - initialCall = { ilService.getRadioAlphabeticalShowsByChannelId(bu = bu, channelId = radioChannelId, pageSize = it.toIlPaging()) }, + initialCall = { + ilService.getRadioAlphabeticalShowsByChannelId(bu = bu, channelId = radioChannelId, pageSize = it.toIlPaging()) + }, nextCall = { ilService.getShowListNextUrl(it) } ) } diff --git a/dataprovider-retrofit/src/main/java/ch/srg/dataProvider/integrationlayer/request/IlStatisticService.kt b/dataprovider-retrofit/src/main/java/ch/srg/dataProvider/integrationlayer/request/IlStatisticService.kt index 6c310aa..deaf656 100644 --- a/dataprovider-retrofit/src/main/java/ch/srg/dataProvider/integrationlayer/request/IlStatisticService.kt +++ b/dataprovider-retrofit/src/main/java/ch/srg/dataProvider/integrationlayer/request/IlStatisticService.kt @@ -14,10 +14,16 @@ interface IlStatisticService { suspend fun getMediaStatisticByUrn(@Path("urn") urn: String): MediaStatisticResult @POST("2.0/mediaStatistic/byUrn/{urn}/clicked") - suspend fun postMediaClicked(@Path("urn") urn: String, @Body mediaStatisticsBody: MediaStatisticPost): MediaStatisticResult + suspend fun postMediaClicked( + @Path("urn") urn: String, + @Body mediaStatisticsBody: MediaStatisticPost + ): MediaStatisticResult @POST("2.0/mediaStatistic/byUrn/{urn}/liked") - suspend fun postMediaLiked(@Path("urn") urn: String, @Body mediaStatisticsBody: MediaStatisticPost): MediaStatisticResult + suspend fun postMediaLiked( + @Path("urn") urn: String, + @Body mediaStatisticsBody: MediaStatisticPost + ): MediaStatisticResult @POST("2.0/mediaStatistic/byUrn/{urn}/shared/{service}") suspend fun postMediaShared( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 990e3ab..b285d77 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,8 +3,8 @@ android-gradle-plugin = "8.5.2" androidx-activity = "1.9.1" androidx-annotation = "1.8.2" androidx-test-ext-junit = "1.2.1" +detekt = "1.23.6" -detekt = "1.22.0" junit = "4.13.2" kotlinPlugin = "1.9.10" kotlinxSerializationJson = "1.6.0" @@ -20,6 +20,7 @@ robolectric = "4.11.1" androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx-activity" } androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } +detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } junit = { module = "junit:junit", version.ref = "junit" } lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel" } @@ -28,7 +29,6 @@ logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", ver material = { module = "com.google.android.material:material", version.ref = "material" } paging-common = { module = "androidx.paging:paging-common", version.ref = "paging-common" } retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } -detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } retrofit2-kotlinx-serialization-converter = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version.ref = "retrofit2KotlinxSerializationConverter" } robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } From 9ee90eefb3c2cb96d5390f581ee6ec9392e37835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 16:06:18 +0200 Subject: [PATCH 08/18] Update Kotlin --- gradle/libs.versions.toml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b285d77..4e1628f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,9 +4,9 @@ androidx-activity = "1.9.1" androidx-annotation = "1.8.2" androidx-test-ext-junit = "1.2.1" detekt = "1.23.6" - junit = "4.13.2" -kotlinPlugin = "1.9.10" +kotlin = "2.0.20" + kotlinxSerializationJson = "1.6.0" lifecycle-viewmodel = "2.6.1" logging-interceptor = "4.9.1" @@ -21,8 +21,8 @@ androidx-activity = { module = "androidx.activity:activity", version.ref = "andr androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } - junit = { module = "junit:junit", version.ref = "junit" } + lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel" } lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle-viewmodel" } logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "logging-interceptor" } @@ -37,6 +37,5 @@ robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectr android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } -kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinPlugin" } -kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinPlugin" } - +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } From 21874c8a7c044e065466f233d75bd3e01f48085e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 16:10:41 +0200 Subject: [PATCH 09/18] Update KotlinX Serialization --- .../dataProvider/integrationlayer/data/DataProviderJson.kt | 2 -- gradle/libs.versions.toml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/DataProviderJson.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/DataProviderJson.kt index 431a0b1..1759c01 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/DataProviderJson.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/DataProviderJson.kt @@ -1,9 +1,7 @@ package ch.srg.dataProvider.integrationlayer.data -import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.json.Json -@OptIn(ExperimentalSerializationApi::class) val DataProviderJson = Json { ignoreUnknownKeys = true encodeDefaults = true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4e1628f..539014c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,8 +6,8 @@ androidx-test-ext-junit = "1.2.1" detekt = "1.23.6" junit = "4.13.2" kotlin = "2.0.20" +kotlinx-serialization = "1.7.2" -kotlinxSerializationJson = "1.6.0" lifecycle-viewmodel = "2.6.1" logging-interceptor = "4.9.1" material = "1.9.0" @@ -22,6 +22,7 @@ androidx-annotation = { module = "androidx.annotation:annotation", version.ref = androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } junit = { module = "junit:junit", version.ref = "junit" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel" } lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle-viewmodel" } @@ -29,7 +30,6 @@ logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", ver material = { module = "com.google.android.material:material", version.ref = "material" } paging-common = { module = "androidx.paging:paging-common", version.ref = "paging-common" } retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } -kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } retrofit2-kotlinx-serialization-converter = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version.ref = "retrofit2KotlinxSerializationConverter" } robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } From b75e2fb0b68d540a0331c5764e0b0f1b2988a7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 16:16:36 +0200 Subject: [PATCH 10/18] Update AndroidX Lifecycle --- dataproviderdemo/build.gradle.kts | 4 ++-- gradle/libs.versions.toml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dataproviderdemo/build.gradle.kts b/dataproviderdemo/build.gradle.kts index 9b8c2be..7f91951 100644 --- a/dataproviderdemo/build.gradle.kts +++ b/dataproviderdemo/build.gradle.kts @@ -59,6 +59,6 @@ dependencies { implementation(project(":dataprovider-retrofit")) implementation(libs.androidx.activity) implementation(libs.material) - implementation(libs.lifecycle.runtime) - implementation(libs.lifecycle.viewmodel) + implementation(libs.androidx.lifecycle.runtime) + implementation(libs.androidx.lifecycle.viewmodel) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 539014c..df366cd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,13 +2,13 @@ android-gradle-plugin = "8.5.2" androidx-activity = "1.9.1" androidx-annotation = "1.8.2" +androidx-lifecycle = "2.8.4" androidx-test-ext-junit = "1.2.1" detekt = "1.23.6" junit = "4.13.2" kotlin = "2.0.20" kotlinx-serialization = "1.7.2" -lifecycle-viewmodel = "2.6.1" logging-interceptor = "4.9.1" material = "1.9.0" paging-common = "3.2.0" @@ -19,13 +19,13 @@ robolectric = "4.11.1" [libraries] androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx-activity" } androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } +androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "androidx-lifecycle" } +androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "androidx-lifecycle" } androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" } detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } junit = { module = "junit:junit", version.ref = "junit" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } -lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-viewmodel" } -lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle-viewmodel" } logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "logging-interceptor" } material = { module = "com.google.android.material:material", version.ref = "material" } paging-common = { module = "androidx.paging:paging-common", version.ref = "paging-common" } From 80dc5eeffc4b8e7fbb995ad7eab1e246f0884171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 16:23:36 +0200 Subject: [PATCH 11/18] Update OkHttp --- dataprovider-retrofit/build.gradle.kts | 2 +- gradle/libs.versions.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dataprovider-retrofit/build.gradle.kts b/dataprovider-retrofit/build.gradle.kts index 7c91e12..d375ec2 100644 --- a/dataprovider-retrofit/build.gradle.kts +++ b/dataprovider-retrofit/build.gradle.kts @@ -55,7 +55,7 @@ dependencies { api(libs.retrofit) compileOnly(libs.androidx.annotation) implementation(libs.retrofit2.kotlinx.serialization.converter) - implementation(libs.logging.interceptor) + implementation(libs.okhttp.logging.interceptor) testImplementation(libs.junit) testRuntimeOnly(libs.robolectric) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index df366cd..ddf80eb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,8 +8,8 @@ detekt = "1.23.6" junit = "4.13.2" kotlin = "2.0.20" kotlinx-serialization = "1.7.2" +okhttp = "4.12.0" -logging-interceptor = "4.9.1" material = "1.9.0" paging-common = "3.2.0" retrofit = "2.9.0" @@ -25,8 +25,8 @@ androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "a detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } junit = { module = "junit:junit", version.ref = "junit" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } +okhttp-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" } -logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "logging-interceptor" } material = { module = "com.google.android.material:material", version.ref = "material" } paging-common = { module = "androidx.paging:paging-common", version.ref = "paging-common" } retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } From f1b6300ce2a754d32f40908607bb53109621e57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 29 Aug 2024 16:32:06 +0200 Subject: [PATCH 12/18] Remove unneeded Material dependency --- dataproviderdemo/build.gradle.kts | 1 - .../src/main/res/values-night/themes.xml | 14 +------------- dataproviderdemo/src/main/res/values/colors.xml | 10 ---------- dataproviderdemo/src/main/res/values/themes.xml | 14 +------------- gradle/libs.versions.toml | 2 -- 5 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 dataproviderdemo/src/main/res/values/colors.xml diff --git a/dataproviderdemo/build.gradle.kts b/dataproviderdemo/build.gradle.kts index 7f91951..46255fb 100644 --- a/dataproviderdemo/build.gradle.kts +++ b/dataproviderdemo/build.gradle.kts @@ -58,7 +58,6 @@ android { dependencies { implementation(project(":dataprovider-retrofit")) implementation(libs.androidx.activity) - implementation(libs.material) implementation(libs.androidx.lifecycle.runtime) implementation(libs.androidx.lifecycle.viewmodel) } diff --git a/dataproviderdemo/src/main/res/values-night/themes.xml b/dataproviderdemo/src/main/res/values-night/themes.xml index f9ee8ca..234fb4a 100644 --- a/dataproviderdemo/src/main/res/values-night/themes.xml +++ b/dataproviderdemo/src/main/res/values-night/themes.xml @@ -1,16 +1,4 @@ - + +